1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Control session length?

Discussion in 'XenForo Questions and Support' started by SgtSpike, Sep 11, 2011.

  1. SgtSpike

    SgtSpike Member

    A user is reporting being automatically logged out after 30 minutes. They prefer to not have permanent sessions, but would like to stay logged in for longer than 30 minutes. Is there a way to control this?
     
  2. James

    James Well-Known Member

    ACP -> Options -> User Options -> Online Status Timeout (minutes)

    (On second thought, I'm not sure if this actually logs them out or just stops showing them on who's online)
     
  3. SgtSpike

    SgtSpike Member

    That's just for showing who is online/active.
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

  5. SgtSpike

    SgtSpike Member

    Ok, is there any way to adjust such timer? The time given by the user was just an estimate, so I wouldn't be surprised if it was actually an hour that he experienced. I'm looking to set it to 2 hours.
     
  6. James

    James Well-Known Member

    XenForo_Session:
    PHP:
    public function __construct(array $config = array(), Zend_Cache_Core $cache nullZend_Db_Adapter_Abstract $db null)
    {
    if (empty(
    $config['admin']))
    {
    $defaultConfig = array(
    'table' => 'xf_session',
    'cookie' => 'session',
    'lifetime' => 3600
    );
    }
    Changing lifetime should increase the session timeout, I'm not sure if it'll do anything to existing sessions though so you might want to wait for some kind of official response (or at least a Brogan/Jake response ;))
     
    LondonDragon and Brogan like this.
  7. Brogan

    Brogan XenForo Moderator Staff Member

    I'm no expert but I don't think any changes made to the lifetime will be reflected in existing cookies.

    Won't really matter after an hour or so though (or the next log in) as a new cookie will be set.
     
    James likes this.
  8. SgtSpike

    SgtSpike Member

    Thanks, will give that a try!
     
  9. SgtSpike

    SgtSpike Member

    Hmmm... where is the php file that contains that code?
     
  10. James

    James Well-Known Member

    library/XenForo/Session.php
     
    Jake Bunce likes this.
  11. LondonDragon

    LondonDragon Active Member

    Just what I was looking for, thanks James :)
     
  12. Brivium

    Brivium Well-Known Member

    I found that session timeout be cleared by Hourly Cron job -> This is the reason for maximum time = 60 minutes.

    To fixed that Open CronJob and remove or move SessionOnline to another
     

Share This Page