7

I am working on enabling persistence using the built in admin settings. I enabled persistence and remember me options, and set the session time to a month. The issue is it seems to only be partially working.

On my site if you are not logged in you cannot see pricing, and you see login and account creation on the homepage when you are not logged in, and see a different homepage if you are logged in.

If I log in with persistence enabled, and come back after a few hours, I come back to a psuedo logged in state. I can see pricing, and where it normally says "Welcome USER" I see the "Not USER?" prompt. But I see the logged out homepage, ie the login and account creation links instead of the logged in homepage. In addition, I can add items to my cart (normally restricted to non-logged in customers), but when I move to checkout it prompts me to login.

So I seem to be in some psuedo logged in state, and I cannot figure out why this is. I want to have persistence enabled, but I want it to leave a user fully logged in, not partially logged in as seems to be the case.

Any ideas what may be causing this issue?

  • 2
    Just a quick idea: Maybe that is cache related? What kind of caches do you use? – Anna Völkl Jun 30 '15 at 20:16
  • What is the session storage being used in local.xml ? – B00MER Jun 30 '15 at 21:27
  • Filesystem session storage. and the site is on an nginx server. – tsHunter Jun 30 '15 at 22:47
  • Could you add the code you using for hiding the "add to cart" button. Are you checking to see if a cookie exist or using magento builtin is customer login functionality? Also could you disable any full-page cache. – Renon Stewart Jul 1 '15 at 19:57
1

Persistent Shopping Cart

Using a persistent shopping cart can help reduce the number of abandoned shopping carts and increase sales. It is important to understand that the persistent shopping cart does not expose sensitive account information at any time. While the persistent shopping cart is use, both registered customers and guest shoppers are required to either log in to an existing account, or create a new account before going through checkout. For guest shoppers, a persistent shopping cart is the only way to retrieve information from a previous session.

See http://merch.docs.magento.com/ce/user_guide-Jan-29/content/order-processing/shopping-cart-persistent.html

Then seem to be functioning correctly according to above description from magento that state thatshoppers are required to either log in or create new account.

Also since you using file base session, you should try to change your session.gc_maxlifetime to ensure the user is still log in and not just persistent shopping cart.

session.gc_maxlifetime specifies the number of seconds after which data will be seen as 'garbage' and cleaned up. Garbage collection occurs during session start.

0

From my understanding it sounds as though the functionality you're describing is expected of the persistent cart module. It however may not take into account most will always display pricing.

Remember almost everything related to Magento's cart is based around quotes, regardless of even checking out simply adding to cart creates a quote, etc.

So in such a state, you've logged in, added an item to cart, your session/login is now associated with the quote. Upon returning (if not logging out) after the expiration of the main frontend cookie your session will be recognized by a cookie and rebuild based off your previous session. So technically, Magento see's that you are in a, as you put it, pseudo login state. Which technically means you have logged in, hence the reason you are see pricing.

See more details in the user guide on different states:

There are a number of observers in the Persistent module that could be reworked for the functionality you are looking for:

An older post but may have some more insight on customizing for what you are looking to achieve:

You may also need to hole punch (FPC) or expire some block cache related to the customer upon reinitialization of the session.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.