Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Session timeout - Customers lose cart contents


SpankyAndy

Recommended Posts

Hi all,

 

I've been aware of this problem for a few months, but haven't been inclined to do anything about it up until now, which was stupid of me...

 

Several times I've seen customers who've added something to their cart, then stopped browsing for a relatively long period. From what I gather, if they resume browsing within 15 minutes (or thereabouts), their items remain within the session cart and all is well. If they show no activity for more than the 15 minutes, the session times out and they lose the contents.

 

On a few occasions, I've watched people lose many items, then spend 15-20 minutes going back through the shop and adding them all back in again. The other times I've seen this, the visitor resumes browsing, then leaves - presumably when they discover all their effort shopping has been wasted.

 

I would have been inclined to test the 'force cookie usage' option, but this isn't possible as I'm using shared SSL on a separate URL, so the cart contents don't pass through to the checkout. STORE_SESSIONS is set to mysql.

 

Does anybody know how I can rectify this by either increasing the session timeout (thereby reducing the frequency of the problem) or storing the sessions details for a much longer period of time (2 weeks, maybe)?

 

Cheers

 

Andy

Link to comment
Share on other sites

Hi all,

 

I've been aware of this problem for a few months, but haven't been inclined to do anything about it up until now, which was stupid of me...

 

Several times I've seen customers who've added something to their cart, then stopped browsing for a relatively long period. From what I gather, if they resume browsing within 15 minutes (or thereabouts), their items remain within the session cart and all is well. If they show no activity for more than the 15 minutes, the session times out and they lose the contents.

 

On a few occasions, I've watched people lose many items, then spend 15-20 minutes going back through the shop and adding them all back in again. The other times I've seen this, the visitor resumes browsing, then leaves - presumably when they discover all their effort shopping has been wasted.

 

I would have been inclined to test the 'force cookie usage' option, but this isn't possible as I'm using shared SSL on a separate URL, so the cart contents don't pass through to the checkout. STORE_SESSIONS is set to mysql.

 

Does anybody know how I can rectify this by either increasing the session timeout (thereby reducing the frequency of the problem) or storing the sessions details for a much longer period of time (2 weeks, maybe)?

 

Cheers

 

Andy

 

includes/functions/sessions.php

if (STORE_SESSIONS == 'mysql') {
   if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime')) {
     $SESS_LIFE = 1440;
   }

 

I advise against 2 weeks. maybe an hour or so. try setting the 1440 to 2880.

 

Tim

Link to comment
Share on other sites

Hi all,

 

From what I gather, if they resume browsing within 15 minutes (or thereabouts), their items remain within the session cart and all is well. If they show no activity for more than the 15 minutes, the session times out and they lose the contents.

 

 

If the customer is registered then the cart content is permanent until the user removes it.

Link to comment
Share on other sites

includes/functions/sessions.php

if (STORE_SESSIONS == 'mysql') {
   if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime')) {
     $SESS_LIFE = 1440;
   }

 

I advise against 2 weeks. maybe an hour or so. try setting the 1440 to 2880.

 

Tim

 

That was a quick response ! Thanks very much Tim !

 

I've change it to 4320 (3x default) to see how that goes. Is there any difference in the length of time the sessions are stored if they're file based? Is there any benefit or disadvantages to using file over database stored sessions?

 

Andy

Link to comment
Share on other sites

That was a quick response ! Thanks very much Tim !

 

I've change it to 4320 (3x default) to see how that goes. Is there any difference in the length of time the sessions are stored if they're file based? Is there any benefit or disadvantages to using file over database stored sessions?

 

Andy

You must also consider the possibility that some of your 'customers' that add item to the cart are simply search engines following links.

Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Link to comment
Share on other sites

You must also consider the possibility that some of your 'customers' that add item to the cart are simply search engines following links.

 

True, although the behaviour I'm referring to are definitely real visitors. I use Who's online enhancement v3.5.4 which shows the visitor DNS entries. Most of the UK ADSL/cable users are easy to spot using this.

Link to comment
Share on other sites

That was a quick response ! Thanks very much Tim !

 

I've change it to 4320 (3x default) to see how that goes. Is there any difference in the length of time the sessions are stored if they're file based? Is there any benefit or disadvantages to using file over database stored sessions?

 

Andy

With all honesty, I am answering based upon what I can recall reading and not concrete knowledge.

 

The above fix is only good for sql sessions.

Sql is preferred, but not sure I ever read why.

 

Tim

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...