amember sessions and time outs

Discussion in 'Customization & add-ons' started by ianternet, Oct 1, 2009.

  1. ianternet

    ianternet aMember Pro Customer

    Joined:
    Jun 26, 2009
    Messages:
    52
    is there a way for amember to reload a page if a session times out or a JS error box to popup saying sessions has expired. or even a way for a window to popup saying would you like to stay logged in.

    how can we prolong the session cause I also have a keep logged in forever but I do not think that will work for users currently.

    I just want to kow how we can extend someone login in our memebership if possible

    where do I look to adjust? and how
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    To increase the amember timeout time:
    In the amember/config.inc.php
    Add this line to the top (90 is minutes):
    ini_set('session.cookie_time', 90);

    David
  3. ianternet

    ianternet aMember Pro Customer

    Joined:
    Jun 26, 2009
    Messages:
    52
    thanks!! will give this a shot!
  4. ianternet

    ianternet aMember Pro Customer

    Joined:
    Jun 26, 2009
    Messages:
    52
    "what if the the time out accurs, what code can we add to auto redirect them to the login.
    For example, they are idle on a page too long, and they are really logged out. What is best way to catch that and redirect them.
    Is there something that can redirect them instantly to login once session is timed out? We need to not have the user have access to that page, and immediatly redirected, if the session variable is expired.
  5. ianternet

    ianternet aMember Pro Customer

    Joined:
    Jun 26, 2009
    Messages:
    52
    no solution for this? I want to refresh the page and log the person out if their sessions times out because users get sql errors if their sessions times out
  6. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    You can use this code at the top of your scripts:
    Code:
    session_start(); 
    if(!$_SESSION[_amember_id]){
    header("Location: /amember/login.php");
    exit; 
    }
    
  7. quirk

    quirk Member

    Joined:
    Apr 1, 2011
    Messages:
    76
    This hasn't worked for me... set the timeout to 6000 minutes and amember still logs out after about 3 hours.

    Can't edit php.ini, I'm on a shared server. How else can I increase the timeout time?

    Thanks
  8. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    @quirk: on some shared hosts they allow you to override the default php.ini settings by placing one locally in the domain root or application root folder.

Share This Page