Results 1 to 3 of 3
Feb 21, 2013, 14:34 #1
How can I make a Session persist through a browser exit?
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.
Feb 21, 2013, 15:36 #2
- Join Date
- Feb 2012
- United Kingdom
- 2 Post(s)
- 0 Thread(s)
You can over-ride PHP's default session handling mechanism by using the session_set_save_handler() function. This enables you to achieve session persistence by storing the session data inside a database.
Feb 21, 2013, 16:05 #3