Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Jan 2015
    Location
    Us
    Posts
    8
    Plugin Contributions
    0

    Default Problem about Adjusting Customer Session

    Hello everyone!
    I am using Zen Cart 1.5.3 and am having issues extending my customer session length. I have tried a few things including adding php_value session.gc_maxlifetime 86400 to my root .htaccess. I have also tried editing the $SESS_LIFE = 1440; variable in sessions.php. My session.gc_maxlifetime local and master stay set at 900 and 1400 respectively no matter what I try. I am not sure if those numbers should change but regardless, my session times out after the 15 min my local is set to. I have recently tried installing keepcart and although it appears to have installed successfully, my session still times out. I am thinking it must be something related to the server setup but do not know where to go from here. Any advice would be appreciated.

    Also, just to clarify this is occurring during guest checkout and I do have COWOA installed.
    Author: internet việt nam
    Thank's!
    Công ty Du lịch việt website >> https://dulichviet.net.vn/https://jobs.drupal.org/company/15207https://www.scout.org/user/2802935 chuyên dịch vụ viễn thông và du lịch.

  2. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Problem about Adjusting Customer Session

    Quote Originally Posted by macbookpro View Post
    Hello everyone!
    I am using Zen Cart 1.5.3 and am having issues extending my customer session length. I have tried a few things including adding php_value session.gc_maxlifetime 86400 to my root .htaccess
    Why so long? As a general rule 15mins is plenty long enough to assume that the customer has left the store.

    Quote Originally Posted by macbookpro View Post
    have also tried editing the $SESS_LIFE = 1440; variable in sessions.php.
    The $SESS_LIFE variable can be set in several places of the sessions.php file. Are you setting the right one in the right place?

    Also, while looking at this code I noted that one of these places is supposed to be via a define('SESSION_TIMEOUT_CATALOG') setting, but I can't seem to find this setting in my database or any of the file defines. I don't know if this is 'normal' or not.

    I suggest you perform a DB and file search on your site to see if you can find this constant and define it to your needs.

    Quote Originally Posted by macbookpro View Post
    My session.gc_maxlifetime local and master stay set at 900 and 1400 respectively no matter what I try. I am not sure if those numbers should change
    The master will probably never change as this is a server configuration setting.

    The local will change dependant on whatever you have changed it too. If you are unable to get it to change it suggests that you need to configure it elsewhere or in a different manner. I suspect that placing it in the .htaccess file may work with some servers but not others.

    Quote Originally Posted by macbookpro View Post
    but regardless, my session times out after the 15 min my local is set to. I have recently tried installing keepcart and although it appears to have installed successfully, my session still times out.
    I don't know anything about 'keep cart', but if a logged in customer has contents in their cart and they get logged out, those contents will be restored to their cart when they next log in. There really isn't any need (that I'm aware of) for a customer Session to time out any longer than 15minutes.

    This 15minutes doesn't limit the time a customer can spend browsing the site. It simply means they'll be automatically logged out after 15minutes of inactivity.

    If you want a 'dirty' fix.

    In sessions.php find
    Code:
    if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime')) {
    $SESS_LIFE = 1440 ; 
    }
    Replace with
    Code:
    // if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime')) {
    $SESS_LIFE = 86400 ; 
    // }
    I make no guarantee that this will work. There are probably a dozen better ways of doing this. I make this proposal as 'a proof of concept' rather than a real solution.

    It might just achieve what you are asking for though.

    Cheers
    RodG

 

 

Similar Threads

  1. Adjusting Customer Session Length
    By tomtom55 in forum General Questions
    Replies: 2
    Last Post: 26 Jan 2015, 07:56 PM
  2. v151 Customer reported problem about making an account
    By DannyVarley in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 23 Jun 2013, 03:44 PM
  3. Question about session id
    By yonghs in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 26 Nov 2008, 01:27 PM
  4. Problem with old customer login/session??
    By divinelighting in forum General Questions
    Replies: 6
    Last Post: 24 Apr 2008, 08:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg