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?
christamccAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
0
QuinnDexCommented:
could you use cookies to store the cart id
0
Ray PaseurCommented:
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?
0
christamccAuthor 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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.