WPIntell

Source evidence

[Plugin: Mage Enabler] Customer session variable

Mage Enabler · support · 2011-02-22T06:59:00+00:00

questionsentiment
highseverity
0.88relevance
5replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

9 / 39 rows with source links

23.1% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

30 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
darthczyz resolved
Hi Richard, I was wondering if you knew anything about the checkout/cart variables. I can login, and add items to the cart, and see that they’re there. However, when I logout, the items are still in the cart. Do you know if Magento does something extra during the logout process that is not covered by Mage::getSingleton(“customer/session”)->logout(); ? Or do I need to load specific sessions into the customer/session variable to restore/unload the cart? Thanks for any help. I know this is probably beyond the mage enabler plugin, but it’s the last piece I’d like to plug in to my site. Thanks, Chris I think the login doesn’t delete the cookie where the Magento session is tied up. You have to truncate the cart also when you call the logout method. See http://mysillypointofview.richardferaro.com/2009/04/13/how-to-delete-a-quote-in-magento/ Thanks Richard! I’ll try that out. OK, so now they are all getting erased on logout, meaning the next user does not have any in his cart when he logs in. However, when the original user logs back in, they’re all gone too. I’d really like it if you could add some stuff to your cart, logout, then log back in and see your cart again. I think that’s the default Magento behavior. So I guess I’m looking for a way to associate a checkout/session with a particular customer. Is there something different I need to be doing at login to set the quote ID for the current customer? Chris Then query again all cart/quote IDs related to the customer and get the most recent. It only deletes the session, not those stored in the database. OK, thanks again for all of your help!

Comments

5 shown
Richard Feraro 2011-02-22T09:34:00+00:00

I think the login doesn’t delete the cookie where the Magento session is tied up. You have to truncate the cart also when you call the logout method. See http://mysillypointofview.richardferaro.com/2009/04/13/how-to-delete-a-quote-in-magento/

darthczyz 2011-02-22T15:44:00+00:00

Thanks Richard! I’ll try that out.

darthczyz 2011-02-22T18:42:00+00:00

OK, so now they are all getting erased on logout, meaning the next user does not have any in his cart when he logs in. However, when the original user logs back in, they’re all gone too. I’d really like it if you could add some stuff to your cart, logout, then log back in and see your cart again. I think that’s the default Magento behavior. So I guess I’m looking for a way to associate a checkout/session with a particular customer. Is there something different I need to be doing at login to set the quote ID for the current customer? Chris

Richard Feraro 2011-02-23T03:26:00+00:00

Then query again all cart/quote IDs related to the customer and get the most recent. It only deletes the session, not those stored in the database.

darthczyz 2011-02-23T06:45:00+00:00

OK, thanks again for all of your help!