osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

Need help with session timeouts

This is a discussion on Need help with session timeouts within the osCMax v1.7 Discussion forums, part of the osCMax v1.7 Forums category; The session length on our server (virtual hosted) is 24 minutes, and we have noticed that this has caused problems ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v1.7 Forums > osCMax v1.7 Discussion

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 07-27-2005, 12:33 AM
New Member
 
Join Date: Mar 2005
Posts: 21
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
techmatters
Default Need help with session timeouts

The session length on our server (virtual hosted) is 24 minutes, and we have noticed that this has caused problems to some sloooowww shoppers who have had their carts go AWOL during the checkout. I also believe it may be related to missing orders from some paypal transactions (only a very few). However small, a missing order is costly and the client is seeking an explanation as to why. Fair enough too.

I approached our hosting company to extend the session time out period but I was given this "advice":
Quote:
Session garbage collection takes place by default on the server every 24 minutes. This means any sessions stored in the default location will have their data removed at this stage. If this is insufficient to you, you can try saving your session data into a different location by setting session.save_path, or alternatively save your session data to a database heap table. This would also allow you better tracking of orders, as it is easier to interface to a database than to a heap of session data files stored on disk in a volatile location.
Unfortunately this doesn't mean a lot to me as I know nothing about server admin and am self-taught PHP and MySQL

Now my session files are already held in mysql
define('STORE_SESSIONS', 'mysql');

I also have the following settings under configuration in admin:

Session Directory - /tmp (by the way, this directory does exist)
Force Cookie Use - False
Check SSL Session ID - False
Check User Agent - False
Check IP Address - False
Prevent Spider Sessions - True
Recreate Session - True

Is there anything that I can actually do to solve this problem within the realms of OscMAX. How can I stop losing session info after 24 minutes even when my session data is already stored in MySQL? (or at least I think it is)

Any help gladly received.

Janet
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #2  
Old 07-27-2005, 05:11 AM
jpf's Avatar
jpf jpf is offline
Moderator

 
Join Date: Sep 2003
Posts: 1,521
Thanks: 1
Thanked 81 Times in 68 Posts
Rep Power: 10
jpf is just really nicejpf is just really nicejpf is just really nicejpf is just really nicejpf is just really nice
Default RE: Need help with session timeouts

If you have access to your own php.ini file on the server (not in the standard directories that you normally host your file in).

Look for and modify:
session.gc_maxlifetime = 1440
(24min x 60sec)

Change to a higher number like 3600 (60min) but not more....

If you don't have access and your host will not change it for you then there is nothing you can do other than have your customer "refresh" or navigate though your site every 20 mins.

Good luck
__________________
JPF - osCMax Fourm Moderator
Try out our osCMax at: Live Catalog Demo
Limited access Admin: Live Admin Demo
Feel free to add products they way you want and then purchase them -=+=- Sorry nothing will be billed or shipped!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3  
Old 07-27-2005, 05:31 AM
New Member
 
Join Date: Mar 2005
Posts: 21
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
techmatters
Default RE: Need help with session timeouts

Thanks jpf.
As I am on a shared server I do not have access to php.ini. I am happy to tackle the tech support people at the hosting company and push them to increase the time, however, I'm not sure how to "intelligently" respond to the earlier advice given from the hosting company, because according to them I just need to change the place where I store session data to solve the problem. I would appreciate if you could comment on their response and give me a convincing argument why that won't work (so I can convince them, not me).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #4  
Old 07-28-2005, 05:11 AM
jpf's Avatar
jpf jpf is offline
Moderator

 
Join Date: Sep 2003
Posts: 1,521
Thanks: 1
Thanked 81 Times in 68 Posts
Rep Power: 10
jpf is just really nicejpf is just really nicejpf is just really nicejpf is just really nicejpf is just really nice
Default RE: Need help with session timeouts

First of all check via FTP all directories to see if you do have a php*.ini file - some shaired hosts are like a virtual host where you have your own php.ini and you can make changes (also good for changing the "register_globals = Off" to "register_globals = On" as required for MS2 and Max). However not all are like that and not all allow changes. Maybe moving hosting company to one that is more flexable (maybe like AABOX or Future Point).
__________________
JPF - osCMax Fourm Moderator
Try out our osCMax at: Live Catalog Demo
Limited access Admin: Live Admin Demo
Feel free to add products they way you want and then purchase them -=+=- Sorry nothing will be billed or shipped!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #5  
Old 08-16-2005, 01:44 AM
New Member
 
Join Date: Mar 2005
Posts: 21
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 0
techmatters
Default RE: Need help with session timeouts

OK I have solved this problem and post it here for anyone else who may be suffering the same issue.
There IS a way to solve this within oscMAx without having to change server settings. The answer is in the sessions.php file (includes/functions/sessions.php), where we find the code specifically setting the session lifetime to 24 minutes (1440 seconds), for sessions stored in mysql.

Look for this code:
Code:
  if (STORE_SESSIONS == 'mysql') {
    if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime')) {
      $SESS_LIFE = 1440;  
    }
Simply remove the 'if' statement and set the $SESS_LIFE to an appropriate number (in seconds), but as jpf suggested less than 60 minutes.

Like this:
Code:
  if (STORE_SESSIONS == 'mysql') {
          $SESS_LIFE = 3000;   //set to 50 minutes
You can do the same for the sessions.php in the admin folder.
Of course you need to have STORE_SESSIONS set to 'mysql' in both of the configure.php files.

This has helped us solve what was becoming a serious problem of expiring sessions during checkout, particularly when using the Paypal IPN. By the time some people fiddled around on the Paypal site, their session had expired, which resulted in money being taken in Paypal, but no record of the order on our site. Very embarrassing.

However we are now all smiles There was a solution after all.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #6  
Old 08-16-2005, 09:20 AM
michael_s's Avatar
osCMax Developer

 
Join Date: Jul 2002
Location: Phoenix, AZ
Posts: 10,247
Thanks: 66
Thanked 294 Times in 280 Posts
Rep Power: 10
michael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond reputemichael_s has a reputation beyond repute
Default This deserves a sticky!

Great solution. Sticky now...
__________________
Michael Sasek
osCMax Developer


osCMax Templates - Hundreds of premium quality templates. New designs every month!

xShop for osCMax - Windows Based osCMax administration. Improved workflow, security, speed and convenience


osCMax Hosting - From basic hosting to High Availability, Load Balanced arrays, the most experienced osCMax host.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #7  
Old 08-23-2005, 02:53 PM
mag mag is offline
Lurker
 
Join Date: Aug 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
mag
Default Re: RE: Need help with session timeouts

look

Code:
  if (STORE_SESSIONS == 'mysql') {
    if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime+1560')) {
      $SESS_LIFE = 1440;  
    }
itīs not correct ??

its the same as ??

Code:
  if (STORE_SESSIONS == 'mysql') {
          $SESS_LIFE = 3000;  
    }
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread



Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
session id in URL cominus osCMax v1.7 Discussion 3 11-11-2004 05:34 PM
Session ID andyy15 osCommerce 2.2 Modification Help 3 08-15-2004 11:40 PM
Session Help doggifts osCommerce 2.2 Modification Help 1 10-21-2003 07:09 PM
SSL Errors, Session Cookie, Session Cache, NOVICE Problems? hanool osCommerce 2.2 Modification Help 1 09-07-2003 11:49 AM
session id thorben osCommerce 2.2 Installation Help 2 06-03-2003 06:35 AM


All times are GMT -8. The time now is 09:41 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
Copyright 2008 osCMax