Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

How to change JSConnect auto logout if user idle for 2 hours?

edited March 2016 in Vanilla 2.0 - 2.8

My JSConnect is working well.
My problem is this, when user idle/do nothing/AFK on my website for 2 hours, they'll logout automatically from website, but unfortunately they don't logout from vanilla forum.

I have done anything, but with no good result.

  1. I modified define('JS_TIMEOUT', 24 * 60); (at line 10) functions.jsconnect.php, but no luck
  2. I have tried to modified $Configuration['Garden']['Session']['Length'] = '15 minutes'; (at line 40) config-defaults.php, no luck either

What should i do know?
It's nonsense when they can logout automatically if idle/AFK (away from keyboard) from website, but not from the forum.

I need your help, guys.
Thanks!

Comments

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    I have tried to modified $Configuration['Garden']['Session']['Length'] = '15 minutes'; (at line 40) config-defaults.php, no luck either

    Did you not read the top part of that file stating that you should never edit that file ? Or maybe you did not understand what it meant ?

    If you need to add or edit a configuration, you must do it in the config.php

    I would consider using the same timeout for both ?

    Or ask the users to empty their cookies after they leave…

  • Options

    Thankyou for replying, vrijvlinder.

    and sorry for edited that config.

    I would consider using the same timeout for both ?

    Yes, i want to use same timeout like you've said.
    In codeigniter, i can set session expiration, $config['sess_expiration'] = [value number whatever i want];

    But, where to change the session expiration like codeigniter in Vanilla forum with JSConnect??

  • Options
    hgtonighthgtonight ∞ · New Moderator

    You are probably looking for:

    $Configuration['Garden']['Cookie']['SessionExpiry'] = "15 minutes";
    $Configuration['Garden']['Cookie']['PersisExpiry'] = "2 hours";
    

    SessionExpiry sets how long a standard session cookie lasts. PersisExpiry sets how long a persistent session cookie lasts. You could get rid of the "remember me" box on the form and set both those configs to 2 hours if you would like.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options

    i've just installed the latest version of forums.

    when i look in my config file, there's nothing set for cookie or session

    i need to adjust these values. basically i need all users to log out and then log back in because the user ids have changed and its causing havoc with people who are already logged in with their old userid being associated with a different user profile.

    can i just insert these lines into my config file?

  • Options
    hgtonighthgtonight ∞ · New Moderator

    @elr said:
    basically i need all users to log out and then log back in because the user ids have changed and its causing havoc with people who are already logged in with their old userid being associated with a different user profile.

    Changing the cookie salt will effectively log all users out.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options

    thank you, that worked

  • Options

    What is the value will replace in the cookie salt? It is possible to cron this?

Sign In or Register to comment.