skip to Main Content

I’m trying to set up the server to increase the lifetime session to 2 hours to be able to save surveys (Limesurvey) after some time of inactivity. If I try to save after 45 minutes it shows up an error message saying that the session has expired.

I have been reading a lot to find solutions but what I have found so far, didn’t work. Probably because I’m missing something.

This is what I have:

  • Plesk 12.5.30
  • Limesurvey 2.06+ Build 150831
  • PHP 5.3.10

The settings in config-defaults.php (Limesurvey) have:

$config['iSessionExpirationTime'] = 7200;

2 hours which is ok, is what I want but does not work. So I thought that my server settings were overriding the Limesurvey settings. So I went to plesk > domains, selected my domain and clicked on PHP settings, scrolled down and added to the “additional instructions” these two lines:

session.cookie_lifetime = 7200
session.gc_maxlifetime = 7200

So now all my additional instructions looks like this:

max_input_vars = 5000
suhosin.memory_limit = 128
suhosin.post.max_value_length = 5000000
suhosin.post.max_vars = 5000
suhosin.request.max_value_length = 5000000
suhosin.request.max_vars = 5000
suhosin.simulation = 1
session.cookie_lifetime = 7200
session.gc_maxlifetime = 7200

But it didn’t work anyways, I’m still having the same error when trying to save a survey when 45 minutes have elapsed.

Any help would be great.

Thanks a lot.

2

Answers


  1. Check cron tasks:

    cat /etc/cron.d/php5
    
    # /etc/cron.d/php5: crontab fragment for php5
    #  This purges session files in session.save_path older than X,
    #  where X is defined in seconds as the largest value of
    #  session.gc_maxlifetime from all your SAPI php.ini files
    #  or 24 minutes if not defined.  The script triggers only
    #  when session.save_handler=files.
    #
    #  WARNING: The scripts tries hard to honour all relevant
    #  session PHP options, but if you do something unusual
    #  you have to disable this script and take care of your
    #  sessions yourself.
    
    # Look for and purge old sessions every 30 minutes
    09,39 *     * * *     root   [ -x /usr/lib/php5/sessionclean ] && /usr/lib/php5/sessionclean
    
    Login or Signup to reply.
  2. Usually the session directory is shared by all applications on the same webspace.
    So if you have other applications (CMS) running they might set the session timeout shorter and so the LimeSurvey sessions get kicked, too.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search