The same php code it's generating a new PHP Session ID on each reload on Google Chrome, but works ok on Internet Explorer & Edge.
I have this script:p.php
<?php
session_name('CTO');
if ('' === session_id()) {
@session_start();
}
echo("<br>".session_id());
I have two domains:www.mypage.com
(with https)
dev.mypage.com
(without https)
If I go to https://www.mypage.com/p.php
on any browser two or more times, the first time php
create a new sessionId
, but next times, browser shows the same sessionId
.
If I do the same on http://dev.mypage.com/p.php
I have a new sessionId
the first time, and the same the next times.
But, sometimes, something happens to Google Chrome and http://dev.mypage.com/p.php
show a new sessionId
each time it's loaded. But this don't happens on IExplorer or Edge. I have checked the browser Response and Request, and seems like always get a new 'Set cookie' with new Id.
Once Google has stopped working correctly, there are only two solutions: Change the name of the cookie, or delete the cookies for both domains, using 'Settings','Advance',... remove 'All cookies and site data'.
Why does this happen 'sometimes'? and only with Google Chrome?