Session Solution Needed

I have a site with two different sections, which are basically two different eCommerce solutions.  One, the "Shop", is robust and requires a log-in to an account  to order.  The other, "Subscribe", is just a simple add to cart and checkout store with no log-in required.

My issue is the sessions. The Shop controls the sessions (starts them when the site loads, destroys and starts again upon log-in, and destroys them at checkout/logout).  The simple Subscription cart uses session for order id and cart id. (The Sub cart is not affecting the session, as it just unsets the order_id and cart_id session only after checkout.)

So of course if someone jumps around and say logs into the Shop after adding something to their Subscription cart, then the Subscription cart loses the the cart id.

What would you suggest I do to allow the Subscription Cart to function more independently?
Who is Participating?
christamccConnect With a Mentor Author Commented:
The whole site is a Zen Cart and the sub cart sits within the framework.  I found a function in Zen Cart called zen_session_recreate that is called and changes the session_id under certain circumstance like LogIn (and therefore causing the loss of the sub information that uses that session_id as a key).

I was able to expand the function to handle the session_id change within the sub cart too and solve my issue.
Ray PaseurCommented:
Uhh, maybe change the name of the variables that are used to store the session data?  Why is there any motivation to destroy the sessions?  Just unset() the information that is not wanted any more.
QuinnDexConnect With a Mentor Commented:
could you use cookies to store the cart id
Ray PaseurConnect With a Mentor Commented:
If the cart is stored in the session, then PHP is already using cookies to store the session id.  Is this some kind of pre-made shop/subscribe solution from a vendor, or do you have control over the PHP code?
christamccAuthor Commented:
The comments made me think about the problem a little differently. Though "Uhh, maybe change the name of the variables that are used to store the session data?" implies that this is an obvious solution. Please do not assume anything is obvious to a non-expert asking questions on this site.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.