On over 400 computers (98% of the company computers all used by different individuals on different networks all over the world) this code works 100% of the time (the user id passes to each page), on any page navigated to in the crm, as long as the same browser is used and open:
<? session_start();
$user_id = $_SESSION['user_id'];
- All OS Win 10
- All PCs not Macs
- All same version of Chrome
- All allow all cookies
- All same browser settings
However, with the same code, the exact same site, and same OS (win 10), same browser, same browser settings, on a few PCs when I navigate inside the site to other pages, the session drops.
What is it about the other PCs that cause this to happen? There must be some user PC setting causing this.
On the PC's that drop the session I have tried deleting the browser and reinstalling to match the PC that works, I have run all the Win 10 updates, checked for a virus (brand new HP laptop), did as much as I could, short of wiping the HD and starting all over. I can't expect a user to go that far and was hoping someone knew how to fix this
At issue is a few PCs for some reason drop the session when navigating within the crm
The indicators are it is an issue with the Win system of the computers that are dropping the session, but trying to diagnose that is like looking for a needle in a haystack. I am posting here because maybe somebody has had the same issue and know what to set in the windows OS to fix it.
EDIT:
I did discover that if the site address changes to www.site.com instead of just site.com that is what causes the session to drop
I now have to figure out how to hold the session whether it's www. or just the site name
I am sure someone else might have this issue. I discovered quite by accident that when a user navigates with the www. that was killing the session, because all the internal navigation was geared to //site. not www.
The cookie was stored as www. and //site. but no matter, as the navigations are all //site.
The fix was to update the .htaccess to force a www. address to change to //site.
# Remove www from any URLs that have them:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.
RewriteRule ^(.*)$ https://site.xxx/$1 [R=301,L]