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 ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| 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:
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 |
|
#2
| ||||
| ||||
| 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! |
|
#3
| |||
| |||
| 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). |
|
#4
| ||||
| ||||
| 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! |
|
#5
| |||
| |||
| 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;
} Like this: Code: if (STORE_SESSIONS == 'mysql') {
$SESS_LIFE = 3000; //set to 50 minutes 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 |
|
#6
| ||||
| ||||
| 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. |
|
#7
| |||
| |||
| look Code: if (STORE_SESSIONS == 'mysql') {
if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime+1560')) {
$SESS_LIFE = 1440;
} its the same as ?? Code: if (STORE_SESSIONS == 'mysql') {
$SESS_LIFE = 3000;
} |
| Thread Tools | |
| |
| ||||
| 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 |