It seems that there's an issue while Gzip Compression Enabled (Under Global Configuration) and System Cache Plugin (Page Caching) enabled together.
Open Joomla login page (For ex: http://rajesh111.demojoomla.com:81/index.php/component/users/?view=login) in browser.
Now, open the same page in another browser.
If you view source both the pages, you'll notice that the same CSRF token is supplied in the form.
Now, login in the first browser, you'll logged in, that's good.
Now, try to login in the second browser, you'll get "Invalid Token" error.
It should get logged in both the browsers.
Invalid Token error in one of the browser.
PHP Built On Linux jm100.siteground.biz 2.6.32-642.6.2.el6.x86_64 #1 SMP Wed Oct 26 06:52:09 UTC 2016 x86_64
Database Version 5.5.39-36.0-log
Database Collation utf8_general_ci
Database Connection Collation utf8mb4_general_ci
PHP Version 5.6.28
Web Server Apache
WebServer to PHP Interface cgi-fcgi
Joomla! Version Joomla! 3.6.4 Stable [ Noether ] 21-October-2016 16:33 GMT
Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.63 Safari/537.31
Labels |
Added:
?
|
Labels |
Removed:
?
|
This is nothing to do with gzip
This is expected behaviour.
Once a change of user authentication has occurred, the session should be regenerated for security, and this will force a token change.
This is by design.
Closing than. Thanks @PhilETaylor
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-12-11 15:20:08 |
Closed_By | ⇒ | zero-24 |
@PhilETaylor Thanks for your reply.
Yes, I understand once user is logged in, the particular token associated with that session is expired. But, the issue (as per my understanding, please correct me If I'm wrong) is that when you open login page in two "different" browsers (IE and FF for example), both should serve different tokens at first place considering that they both are different sessions although accessed from the same PC.
But the same scenario works when gzip is disabled. I mean, when gzip is disabled, and I open login page in two different browsers it serves me different token.
Any ideas, why that is so?
My previous comments were on the basis of two tabs in the same browser - I stand by those in that context.
I see you edited your reply, so I have now investigated with two different browsers
I cannot replicate your problem with a Firefox and a Chrome browser, with or without gzip enabled.
All I see is the expected behaviour. I can login with both browsers in independent sessions with no token issues.
@PhilETaylor Ok thanks.
I think the issue is that when gZip compression is enabled, the page cache is stored in compressed format. And during the rendering of that cached page, it's not able to replace the CSRF token properly since the data is stored in gZip format.
So, the solution could be something like this:
Filename: libraries/joomla/cache/cache.php
Method: getWorkarounds
Any thoughts?