How can I make a Session persist through a browser exit?

Hey SP,

The website I work on is having some issues with (L)users adding items into their shopping carts, disappearing from their computers for up to a few days and then sending in support emails when they discover that their shopping cart is now empty without them placing their orders.

So first question, is the web server that is destroying the session cookie due to idle? If so, how can I extend this to last say… 1 week?

If it’s not the web server then it must be the clients browser, is there some coding technique I have to utilize to encourage their browser to leave the session cookie open?

Currently I’m just doing a simple session_start(); in the global header include and then using the session_id() to identify the users shopping cart items, which are stored in the mysql Database.

Any tips in the right direction would be appreciated, thank you.

You can over-ride PHP’s default session handling mechanism by using the [i]session_set_save_handler()[/i] function. This enables you to achieve session persistence by storing the session data inside a database.

Thank you. I’ll look into that.