View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
07853Bug reportsSurvey participants (Tokens)public2020-03-13 18:46
Reporternicksanders Assigned ToLouisGac 
PrioritynormalSeverityminor 
Status closedResolutionreopened 
Product Version2.00+ 
Target Version2.05 RC 
Summary07853: Token mismatch when accessing multiple closed surveys
Description

When accessing multiple closed surveys the 1st survey token works but the 2nd returns the message below

Token mismatch

The token you provided doesn't match the one in your session.

Please wait to begin with a new session.

Steps To Reproduce

Create 2 closed surveys
Click on link to 1st
Click on link to 2nd

Additional Information

application/controllers/survey/index.php

comments in _createNewUserSessionAndRedirect imply it should do a redirect so we have put dirty fix in place which I have attached.

I would be happy to do it properly if you point me in the right direction.

TagsNo tags attached.
Attached Files
application_controllers_survey_index.php.diff (1,503 bytes)   
--- index.php.orig	2013-05-14 13:37:25.000000000 +0100
+++ index.php	2013-05-20 18:05:21.803577184 +0100
@@ -62,7 +62,8 @@
             $asMessage = array(
             $clang->gT('Token mismatch'),
             $clang->gT('The token you provided doesn\'t match the one in your session.'),
-            $clang->gT('Please wait to begin with a new session.')
+            $clang->gT('Please press F5 to reload the page.'),
+            '<script>window.location.reload();</script>'
             );
             $this->_createNewUserSessionAndRedirect($surveyid, $redata, __LINE__, $asMessage);
         }
@@ -72,7 +73,8 @@
             $asMessage = array(
             $clang->gT('Previous session is set to be finished.'),
             $clang->gT('Your browser reports that it was used previously to answer this survey. We are resetting the session so that you can start from the beginning.'),
-            $clang->gT('Please wait to begin with a new session.')
+            $clang->gT('Please press F5 to reload the page.'),
+            '<script>window.location.reload();</script>'
             );
             $this->_createNewUserSessionAndRedirect($surveyid, $redata, __LINE__, $asMessage);
         }
@@ -806,6 +808,7 @@
             $templatename=Yii::app()->getConfig('defaulttemplate');;
         }
         // Let's redirect the client to the same URL after having reset the session
+        session_unset();
         $this->_niceExit($redata, $iDebugLine, $templatename, $asMessage);
     }
 
Bug heat6
Complete LimeSurvey version number (& build)130514
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMySQL 5.1.60
Server OS (if known)CentOS 6.4
Webserver software & version (if known)Apache 2.2.24
PHP VersionPHP 5.3.24

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2013-06-30 17:32

developer   ~25691

Think it's best to have :
<a href="">Click here to relaod</a>

DenisChenu

DenisChenu

2013-09-26 16:45

developer   ~26387

Dev: link with specific class: reloadlink and newsurvey to be js adapted.

c_schmitz

c_schmitz

2013-10-11 11:08

administrator   ~26706

2.05RC2 released

DenisChenu

DenisChenu

2018-06-29 02:36

developer   ~48384

Reopen for 3.X

DenisChenu

DenisChenu

2018-06-29 15:54

developer   ~48415

@LouisGac : it's in https://github.com/LimeSurvey/LimeSurvey/blob/master/themes/survey/vanilla/views/layout_errors.twig

Must test if URL is an array , have a link etc …

LouisGac

LouisGac

2018-06-29 17:24

developer   ~48421

could you provide steps to reproduce please?

DenisChenu

DenisChenu

2018-07-01 11:19

developer   ~48425

Create a survey with token
Create and generate 2 token
Via admin GUI : click on first token
Go to survey, but didn't submit
Send you a token via email
Click on the link
With 2.6 or 2.73 : have the link to restart survey (see screenshot), not for 3.0

c_schmitz

c_schmitz

2020-03-13 18:46

administrator   ~56478

This version of LimeSurvey is not longer supported. Please check so that the issue is fixed in a more recent version of LimeSurvey. If it's not, please reopen this bug report. Thank you.

Issue History

Date Modified Username Field Change
2013-05-20 19:14 nicksanders New Issue
2013-05-20 19:14 nicksanders File Added: application_controllers_survey_index.php.diff
2013-06-30 17:32 DenisChenu Note Added: 25691
2013-06-30 17:32 DenisChenu Assigned To => DenisChenu
2013-06-30 17:32 DenisChenu Status new => assigned
2013-09-26 07:54 c_schmitz Target Version => 2.05 RC
2013-09-26 16:45 DenisChenu Note Added: 26387
2013-09-26 16:45 DenisChenu Status assigned => resolved
2013-09-26 16:45 DenisChenu Fixed in Version => 2.05 RC
2013-09-26 16:45 DenisChenu Resolution open => fixed
2013-10-11 11:08 c_schmitz Note Added: 26706
2013-10-11 11:08 c_schmitz Status resolved => closed
2016-12-08 10:39 c_schmitz Category Tokens => Survey participants (Tokens)
2018-06-29 02:35 DenisChenu Assigned To DenisChenu =>
2018-06-29 02:35 DenisChenu Status closed => new
2018-06-29 02:35 DenisChenu Resolution fixed => reopened
2018-06-29 02:36 DenisChenu Note Added: 48384
2018-06-29 02:36 DenisChenu Fixed in Version 2.05 RC =>
2018-06-29 11:09 c_schmitz Assigned To => DenisChenu
2018-06-29 11:09 c_schmitz Status new => assigned
2018-06-29 15:53 DenisChenu Assigned To DenisChenu => LouisGac
2018-06-29 15:54 DenisChenu Note Added: 48415
2018-06-29 17:24 LouisGac Note Added: 48421
2018-07-01 11:19 DenisChenu Note Added: 48425
2018-07-01 11:20 DenisChenu File Added: Capture du 2018-07-01 11-18-44.png
2020-03-13 18:46 c_schmitz Note Added: 56478
2020-03-13 18:46 c_schmitz Status assigned => closed