Jump to content
Larry Ullman's Book Forums

Example 2 Shopping Cart Cookie Issue


Recommended Posts

Hey everyone,

 

I am having an issue with the cookie situation on the shopping cart and wish list pages. They work fine when it comes to adding items to the cart and moving them back and forth between the cart and wish list. The problem comes when I try to access the cart directly, without adding or updating or moving. It is using the same cookie for the other actions but if I go to the cart on its own it redirects me to an empty one. 

 

I figured out that it was a cookie problem as I had it echo the $uid instead of redirecting and I found that the cookie is different when you try to access the cart from the one that was created when you add an item to the cart. This is all happening without closing the browser so I am confused as to why it is not finding the $uid stored in the cookie and is instead creating a new one when I try to access the cart on its own.

 

Any ideas?

Link to comment
Share on other sites

Yah sorry, I figured it out though. Some of the urls had www and some didnt that was storing different cookies. I am having one other problem that you might be able to help me with.

 

I am using the Paypal REST api system, The sending and receiving from that is working fine. The problem I am having is that it seems as though my $_SESSION variables are disappearing when I am redirected back from Paypal. I am getting a undefined variable error when attempting to use the Session variables on the page the customer is redirected to. I need the session variable $_SESSION['order_id'] so I can retrieve the transaction id (stored in the db) to execute the payment.

 

Any ideas?

Link to comment
Share on other sites

 Share

×
×
  • Create New...