View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
12003Bug reportsSurvey participants (Tokens)public2017-02-21 12:00
Reporteranthony_b Assigned ToDenisChenu  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version2.55.x 
Fixed in Version2.63.x 
Summary12003: TOKEN field is blank if user performs a GET during survey
Description

We have been using the replacement field {TOKEN} in the survey end url to send users back to our systems after completing a survey.

We have found an issue that if the user reloads the page (ie, performs a GET request) whilst completing a survey, the TOKEN field is blank in the end URL.

A workaround has been to use {TOKEN:TOKEN} instead, which doesn't appear to exhibit this behaviour, however this is not something listed in the documentation here:

https://manual.limesurvey.org/URL_fields

so I don't think this is the preferred way of doing this.

Steps To Reproduce

Create a survey with at least 1 group/question. Set an end url that contains the token, such as:

http://localhost/?test={TOKEN}

Configure as non-anonymous, activate and init tokens table. Create a token and execute the survey. Advance to the first question, and then resubmit the URL. (Not a browser refresh that will resubmit the POST request, just select the URL in the browser and hit enter for a 'GET').

Complete the survey - the URL should be missing the TOKEN field. If a new token is created and completed normally, without the GET, it should include the token as expected.

Additional Information

Replicated in latest version, also found on an older system running 2.06+ Build 160129 (Debian 8.6, Apache 2.4.10, Postgresql 9.4.9, PHP 5.6.27)

TagsNo tags attached.
Attached Files
01-beforeReload.png (9,561 bytes)   
01-beforeReload.png (9,561 bytes)   
02-afterReload.png (11,034 bytes)   
02-afterReload.png (11,034 bytes)   
Bug heat4
Complete LimeSurvey version number (& build)2.57.1+161205
I will donate to the project if issue is resolvedNo
Browser
Database type & versionPostgresql 9.5.4
Server OS (if known)Gentoo
Webserver software & version (if known)Apache 2.4.23
PHP Version5.6.28

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2016-12-13 08:38

developer   ~42525

Can you test with another question code ?

But it's the issue with "reload" , we don't reset session before show the page.

anthony_b

anthony_b

2016-12-13 23:21

reporter   ~42544

I've created a minimal survey, and after confirming the problem was still there, changed the codes on both the question and group (only one of each present), and the issue can still be demonstrated.

I've attached this minimal survey to the issue - it can be activated with default settings and a token table initialised. Dummy tokens are fine to use.

If you just proceed through the survey clicking submit, the token will be in the end url, but if on the question page you issue a GET request on the same URL, the token will be missing at the end.

DenisChenu

DenisChenu

2016-12-15 09:45

developer   ~42545

I can not confirm issue :
I have this behaviour

1: Reload by F5 (after browser alert and confir)
=> This invitation has already been used. < br >We are sorry but you are not allowed to enter this survey. < br >For further information please contact ()

2: reload via click on Location Bar + Enter
=> To participate in this restricted survey, you need a valid token. < br >If you have been issued a token, please enter it in the box below and click continue. < br > The form

1 and 2 are attended behaviour.

PS : better to use "Automatically load URL when survey complete" to yes for this purpose. Else End Url are really an informationnal url.

DenisChenu

DenisChenu

2016-12-15 09:46

developer   ~42546

Please test with the last 2.57 version

anthony_b

anthony_b

2016-12-16 07:38

reporter   ~42550

I think you might be trying to replicate the problem in the wrong part of the survey. I can obtain the behaviour you describe if I have completed the survey and I am on the survey 'end' page.

To demonstrate the problem, you must be on the 'question page' that is titled 'test group' if using my sample survey. Test scenario '1' (pressing F5) will not generate the problem as this causes the browser to resubmit (POST request), which does not exhibit the problem.

Test scenario '2', performed on the 'test group' page should demonstrate the problem. After doing this, when you subsequently complete the survey there will be no token in the end url.

Just confirming that I am testing with the latest stable release (2.57.1+161205).

Regarding automatically loading the URL, we normally use that option - I just left it switched off for the purposes of a minimal survey to demonstrate the issue. It was only when we had some participants in our study report errors after completing a survey that we discovered in our web logs that a small number were being returned to our site without the token present in the URL, and we worked out that this happened whenever there was a stray 'GET' request against the survey URL.

DenisChenu

DenisChenu

2016-12-16 08:10

developer   ~42551

OK,

"Advance to the first question, and then resubmit the URL. " bad comprehension . :)

DenisChenu

DenisChenu

2016-12-16 08:53

developer   ~42552

Last edited: 2016-12-16 08:56

OK, always reproductible :

Updated a little the survey :

  • Enter with token : test
  • Go to the 1st question page : look at help (screen 01)
  • Reload manually via Location Bar : look at help (screen 02)

Help is Your token are {TOKEN} or {TOKEN:TOKEN}

Same issue in 2.6/06 version

DenisChenu

DenisChenu

2017-02-10 01:15

developer   ~42993

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=22270

Related Changesets

LimeSurvey: master 30304bed

2017-02-10 01:13:40

DenisChenu

Details Diff
Fixed issue 12003: TOKEN field is blank if user performs a GET during survey Affected Issues
12003, 12101
mod - application/controllers/survey/index.php Diff File

Issue History

Date Modified Username Field Change
2016-12-13 04:46 anthony_b New Issue
2016-12-13 08:38 DenisChenu Note Added: 42525
2016-12-13 23:21 anthony_b File Added: limesurvey_survey_634463.lss
2016-12-13 23:21 anthony_b Note Added: 42544
2016-12-15 09:45 DenisChenu Note Added: 42545
2016-12-15 09:45 DenisChenu Reproducibility have not tried => unable to reproduce
2016-12-15 09:46 DenisChenu Status new => feedback
2016-12-15 09:46 DenisChenu Note Added: 42546
2016-12-16 07:38 anthony_b Note Added: 42550
2016-12-16 07:38 anthony_b Status feedback => new
2016-12-16 08:10 DenisChenu Note Added: 42551
2016-12-16 08:50 DenisChenu File Added: survey_archive_TOKENlost.lsa
2016-12-16 08:50 DenisChenu Reproducibility unable to reproduce => always
2016-12-16 08:53 DenisChenu Note Added: 42552
2016-12-16 08:54 DenisChenu File Added: 01-beforeReload.png
2016-12-16 08:54 DenisChenu File Added: 02-afterReload.png
2016-12-16 08:55 DenisChenu Note Edited: 42552
2016-12-16 08:56 DenisChenu Note Edited: 42552
2016-12-29 14:42 DenisChenu Summary TOKEN field is blank when used in survey END URL if user performs a GET during survey => TOKEN field is blank if user performs a GET during survey
2017-02-08 01:41 DenisChenu Assigned To => DenisChenu
2017-02-08 01:41 DenisChenu Status new => assigned
2017-02-10 01:15 DenisChenu Changeset attached => LimeSurvey master 30304bed
2017-02-10 01:15 DenisChenu Note Added: 42993
2017-02-10 01:15 DenisChenu Resolution open => fixed
2017-02-10 01:15 DenisChenu Status assigned => resolved
2017-02-10 01:15 DenisChenu Fixed in Version => 2.62.x
2017-02-21 12:00 c_schmitz Status resolved => closed
2017-02-21 12:00 c_schmitz Fixed in Version 2.62.x => 2.63.x