Session Management – How Browser Cookies Are Affecting Our Live Site

cookiesession

we have a LIVE magento site from last one year.

recently we are facing very difficult problem from Browser cookies.

Frontend is not opening and keep on loading and never load.

we are using HTTPS for secure pages.

we are facing problem in chrome, mozilla , opera, safari and all other browsers.

1)If we clear the BROWSER COOKIES, than its working.

2)If we clear the VAR/SESSION folder, than its working.

3)If we open the site in freshly installed browsers, its working for some time. again same problem. as cookies will occupy after visiting site.

There is no problem in Backend

we followed this : https://stackoverflow.com/questions/15491819/magento-admin-login-not-working-in-chrome-but-works-fine-for-firefox but it did't worked.

IS it related to only cookies problem or our template code problem?

enter image description here

we face issue as in images sometimes.enter image description here

enter image description here

Best Answer

Are you getting double cookies set? Bare Domain AND Subdomain? One for example.com and one for www.example.com?

I found on our site, we needed to do an .htaccess redirect to force everything to whichever was our choice for the website base server domain or we would run afoul of session hijack as the site would respond to one, set a cookie and immediately redirect to the other. Once cookies were double-set things came to grief.

Magento's settings for Cookie Path and domain did not alleviate it, even when correctly set.

Related Topic