Welcome Guest, Not a member yet? Register   Sign In
Strange behavior of CSRF tokens with a low csrf_expire (3.1.2)
#3

(This post was last modified: 01-27-2017, 07:13 AM by spjonez.)

What am I looking for? Here's screenshots of the cookie's for the request to /token and the 403 that happens immediately upon using said token.

/token:

[Image: 5QgflwF.png]

/login 403 with that token:

[Image: bMKVXm4.png]

The params tab shows the same CSRF value that was returned in the response object from the previous call to /token.

Found the issue. All the requests I was sending were POST. My browser cookie was not being updated because of this line:
https://github.com/bcit-ci/CodeIgniter/b...y.php#L209

Changing the /token request to GET and it all works now. Thanks!

Out of curiosity, you mentioned you thought this approach was a bad idea. Do you have an alternative solution where the user will never see a 403 error unless they are doing something they shouldn't be?
Reply


Messages In This Thread
RE: Strange behavior of CSRF tokens with a low csrf_expire (3.1.2) - by spjonez - 01-27-2017, 06:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB