Title: [Plugin: Mage Enabler] Customer session variable
Last modified: August 19, 2016

---

# [Plugin: Mage Enabler] Customer session variable

 *  Resolved [darthczyz](https://wordpress.org/support/users/darthczyz/)
 * (@darthczyz)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-mage-enabler-customer-session-variable/)
 * 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

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Richard Feraro](https://wordpress.org/support/users/richardferaro/)
 * (@richardferaro)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-mage-enabler-customer-session-variable/#post-1928944)
 * 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/](http://mysillypointofview.richardferaro.com/2009/04/13/how-to-delete-a-quote-in-magento/)
 *  Thread Starter [darthczyz](https://wordpress.org/support/users/darthczyz/)
 * (@darthczyz)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-mage-enabler-customer-session-variable/#post-1929125)
 * Thanks Richard! I’ll try that out.
 *  Thread Starter [darthczyz](https://wordpress.org/support/users/darthczyz/)
 * (@darthczyz)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-mage-enabler-customer-session-variable/#post-1929207)
 * 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
 *  Plugin Author [Richard Feraro](https://wordpress.org/support/users/richardferaro/)
 * (@richardferaro)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-mage-enabler-customer-session-variable/#post-1929259)
 * 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.
 *  Thread Starter [darthczyz](https://wordpress.org/support/users/darthczyz/)
 * (@darthczyz)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-mage-enabler-customer-session-variable/#post-1929262)
 * OK, thanks again for all of your help!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘[Plugin: Mage Enabler] Customer session variable’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/mage-enabler.svg)
 * [Mage Enabler](https://wordpress.org/plugins/mage-enabler/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mage-enabler/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mage-enabler/)
 * [Active Topics](https://wordpress.org/support/plugin/mage-enabler/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mage-enabler/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mage-enabler/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [darthczyz](https://wordpress.org/support/users/darthczyz/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-mage-enabler-customer-session-variable/#post-1929262)
 * Status: resolved