Error: Bad Request, CSRF Token

More
2 years 10 months ago #110830 by Renier
Renier replied the topic: Error: Bad Request, CSRF Token
Hi Dennis

I am experiencing the same / similar problem "Bad Request - The CSRF token could not be verified"
The problem is that my client is experiencing this intermittently when submitting pages. (which generally has less than 10 answers on)
We also don't get the problem on the same page.

From 1200 people, 350 completed successfully and only 35 complained about the error.
The problem however is that it is still a significant amount of people.

Please can you give me a idea what I could look for, or how I could go about troubleshooting this problem?

The survey uses TOKENS
Allow multiple responses or update responses with one token = NO
Enable token-based response persistence = YES
We are using Version 2.05+ Build 140618

Regards
Renier

Please Log in to join the conversation.

More
2 years 10 months ago #110919 by DenisChenu
DenisChenu replied the topic: Error: Bad Request, CSRF Token
Hi,

Surely some session issue ?

1st idea: uncomment the database session example in your config.php
2nd idea : Disable CRSF validation : manual.limesurvey.org/Optional_settings#Request_settings

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
1 year 2 months ago #133352 by id_wahyu
id_wahyu replied the topic: Error: Bad Request, CSRF Token
Hi Denis.
I got the "Bad Request CSRF token.." as well. And tried follow the link you provided, try to find it at config.php but failed, I can't find that CSRF part at the config.php
I may open the wrong config.php. Please let me know in which folder that config.php that contain CSRF?

Many thanks

Iwan Wahyu

Please Log in to join the conversation.

More
1 year 2 months ago #133359 by DenisChenu
DenisChenu replied the topic: Error: Bad Request, CSRF Token
You must ADD this part to your config.php.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: id_wahyu

Please Log in to join the conversation.

More
5 months 2 weeks ago #145735 by JamLizzy101
JamLizzy101 replied the topic: Error: Bad Request, CSRF Token
Hi Denis

I was looking at this post with your response as I am going through I think the same issue here. We have LimeSurvey set up on the following domain like so: media5.co.za/limesurvey
I created on DNS server a forwarding sub-domain shortsurveys.talkinsight.com with masking so the url - http://media5/limesurvey would then show as shortsurveys.talkinsight.com
I deduced that the issue revolving around getting the message below was the fact that the framework is getting muddled up by the domain name as it knows it is media5.co.za as what is provided by the server and not shortsurveys.talkinsights.com:-
Bad Request
The CSRF token could not be verified

I saw your response to this post. I made a text addition to my config file, bt before adding this, would the below text be ok for what I had described for this to work? :-

'components' => array(

'session' => array(
'savePath' => '/limesurvey',
'cookieMode' => 'allow',
'cookieParams' => array(
'path' => '/',
'domain' => '.talkinsights.com',
'httpOnly' => true,
),

Please Log in to join the conversation.

More
5 months 2 weeks ago - 5 months 2 weeks ago #145737 by holch
holch replied the topic: Error: Bad Request, CSRF Token
Offtopic: You might want to revise the text on media5.co.za:

YOU'RE ONE STOP DIGITAL AGENCY.


So what you are currently saying is that visitors to your website are "one stop digital agency"?

I assume what you actually want to say is "Your one stop digital agency" I guess?

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
Last Edit: 5 months 2 weeks ago by holch.

Please Log in to join the conversation.

More
5 months 2 weeks ago #145747 by DenisChenu
DenisChenu replied the topic: Error: Bad Request, CSRF Token
'savePath' => '/limesurvey', : remove this : let the the default if it's OK.

I test more with
'path' => '/',
'domain' => 'shortsurveys.talkinsights.com',

but in fact : i'm unsure : depend a lot of server. This can be a broken sessionPath (but you surely don't have the right on /limesurvey directory on server.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in to join the conversation.

More
5 months 1 week ago #145859 by Mazi
Mazi replied the topic: Error: Bad Request, CSRF Token
JamLizzy101, some questions to track this down:

1. Does the problem show up at every survey session?

2. Can you check if the session (and maybe cookie) gets set up correctly when starting the survey and that there is a session file created at the appropriate folder?

3. Which exact Limesurvey version do you use?


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now