Randomly Losing Session Variables Only In Google Chrome & URL Rewriting
I had the same issue, and to fix it I only had to create a favicon.ico and place it in the webroot - otherwise I could see using Fiddler that a 404 resulted for this with every page request from Chrome (despite me not actually linking to a favicon in the page markup).
In my mind this is clearly a bug in Chrome, as the lack of a favicon should have no bearing on session data.
Chrome and session data lost
Solved.
It was the missing favicon problem... (Chrome looks for a favicon and if it doesn't find it, the session data dissapears).
The solution was to put a favicon in the root folder of the project.
Strange problem... but finally solved.
ASP.NET Session lost in Chrome
The issue is on the fetch and not on the server side.
The strange thing is that it's work on IE. Apparently IE don't have the same policy for the fetch API.
You have to make sure to add the property credentials
to include
or same-origin
to keep the session on your request.
Warning : Put credentials to include
fire a security error in Chrome.
The same-origin
value resolved my problem.
Example of request :
fetch(uri,{
method:'GET',
credentials:'same-origin'
})
.then()
.catch()
Chrome session data lost
After a lot of searching I've found the problem...memcache.
For some unknown reason memcache and sessions are not to work together on my PHP installation. Other caching systems are ok, but if I activate memcache sessions are not working in Chrome only.
- PHP 7.1.8
- Memcache 3.0.9-dev
- Memcached 3.0.3
I've also tried with Memcache 3.0.8 (stable) but the result doesn't change...sessions are ok but not in Chrome that loses session every page reload.
Related Topics
Convert Date String to MySQL Datetime Field
Fatal Error: Call to Undefined Function MySQLi_Result()
Anonymous Recursive PHP Functions
Get the Files Inside a Directory
Delete Multiple Rows by Selecting Checkboxes Using PHP
How to Give Each Registered User Their Own Url Using PHP
How to Redirect Domain According to Country Ip Address
How to Remove a Variable from a PHP Session Array
Update Fee Dynamically Based on Radio Buttons in Woocommerce Checkout
Handling Data in a PHP Json Object
Best Way to Check If MySQL_Query Returned Any Results
Assigning the Return Value of New by Reference Is Deprecated
Print_R() Adds Properties to Datetime Objects
How to Change PHP Version in Htaccess in Server
How to Read Last Lines (I.E. "Tail") from a File Using PHP