Welcome Guest, Not a member yet? Register   Sign In
Shopping Cart and Session Data
#1

[eluser]richman[/eluser]
Hi,

Maybe I am going down the wrong track here but I have built a website that stores the the users selected items in a database table called cart.

I use the session id to reference the cart table to look up what is in the cart for a specific user(session_id).

The problem is every now and then the session_id is regenerated leaving me with no way of looking up a specific cart.

Is there any other way of doing this type of thing??
#2

[eluser]ywftdg[/eluser]
How long has passed (time) when the session regenerates? Maybe possible the session is expiring?
#3

[eluser]richman[/eluser]
I had a look at the sess_time_to_update' in the config and set this to 7200 so this should fix the problem as it is set to regenerate every 5 minutes.

I guess what I am asking is - if I change the sess_time_to_update I can fix the problem however is there any other way of referencing the session other than the session_id.

Dont know...
#4

[eluser]ywftdg[/eluser]
Are you asking if there is another way to add another name to that session, if so yes. I am working on something now, I apply my users ID (from database) to it, and reference it only by that.
#5

[eluser]Eric Cope[/eluser]
While I prefer Michael Young's recommendation of a userID that is associated with a session, but session ID independent, you could also extend the session class to update your cart database whenever the session ID changes.
#6

[eluser]richman[/eluser]
Hi Eric,

I like the update cart table idea. Thanks I will try using that method.

Rich




Theme © iAndrew 2016 - Forum software by © MyBB