Magento session lost when switching to https from http

删除回忆录丶 提交于 2019-12-19 03:38:06

问题


I've searched high and low for a solution to this, with no luck. My host told me they are too busy to help.

Magento 1.4.2 // SSL cert

1- When I add an item to cart, the page reloads and my item is added to cart. [good]

2- Next, I click home, and my items are no longer visible in cart sidebar. [bad]

3- Next, I click "Tops", and my items are still not visible in cart sidebar. [bad]

4- Next , I click "Bottoms" and the items show just fine.

In all cases where the cart isn't visible, I can add https to the URL and the cart loads up just fine. Can anyone help me figure out why my session is being lost between http and https?

I have all my backend web cookie settings set to "no" except for sID.

Also- When a user is logged in, the cart items ALWAYS show on the right. It's only screwy if they're a guest.

Thanks guys, if you need me to post any code let me know.

wwwdotlylifdotcom

EDIT: Here is a screenshot of my cookies session in firebug (not exactly sure what I am looking at). Hope this helps.

And here is my Session settings in magento: I have tried just about every variation of turning these on and off.

EDIT!

This issue has actually been narrowed down to a cache issue. We found out that when the cache is dumped/deleted, the website works properly. But after a few minutes of surfing the problem happens again. Does anyone have any idea? (And should i change the question title?)

I'm using a module called Lightspeed from TinyBrick, and it seems the new cache options are messing with our site. =( I'm contacting them shortly.

**EDIT Tinybricks excellent support helped us out. Thanks for all of your suggestions.


回答1:


Is the session cookie being set to be HTTPS-only? That'll prevent it from being carried over to regular HTTP requests, effectively giving the user two different sessions.




回答2:


You have in your screenshot two frontend cookie with two domains, one with www and an other one without. Check if you have a correct domain name in the configuration > Web tab > Cookie Management > Cookie Domain (or something close to that). If it's empty set it to ".mydomain.com" and try again. Check if you don't have different cookie domain in your configuration in the other store views, set them to "use website".

If still doesn't work, What are the values of the fields of cookie management and the cookie validation settings




回答3:


We were experiencing similar issues where our custom nav (depending on whether a user was logged in or not, was not very consistent across different pages.

We followed the suggestion @ http://ka.lpe.sh/2011/06/19/magento-checking-customer-admin-is-logged-in-or-not/ to check if a user was logged base on the frontend session variable before a rendering a particular block, and it seems to have done the trick.

Perhaps you can try something similar.




回答4:


Tinybricks excellent support helped us out. Thanks for all of your suggestions. This was a localized problem based off cache and a module called Lightspeed.



来源:https://stackoverflow.com/questions/7823994/magento-session-lost-when-switching-to-https-from-http

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!