how to reset a session variable at logout?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • impin
    New Member
    • Jul 2010
    • 127

    how to reset a session variable at logout?

    i am calculating the users break time...

    when the user logged in the break time will be assigned to him... say 60 mins..

    the user take several breaks... for example in first break he used 20 mins and second break 30 mins and so on..

    i calculate the remaining break time from every break the uyer takes. the problem is when user logged in next time the break time is not reseting to 60 mins... the break time variable holds the last value.. it not reseting to 60 mins...



    when the user logout, it automatically set the break time to 60 mins... how to do it?

    so next time the user logged in it must show the break time is 60 mins...

    how to do it? plz help.
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    Just overwrite the session variable in the login script.

    // login
    // authentica
    // reset session time ($_SESSION['break_time'] = 60);

    Dan

    Comment

    • impin
      New Member
      • Jul 2010
      • 127

      #3
      i tried but not working...
      this is my script.

      Code:
      include('config.php');
      session_start();
      $user_check=$_SESSION['login_user'];
      $ses_sql=mysql_query("select uname from user where uname='$user_check' ");
      
      $row=mysql_fetch_array($ses_sql);
      
      $login_session=$row['uname'];
      
      $_SESSION['break_time']=3600;
      
      if(!isset($login_session))
      {
      header("Location:home.php");
      }

      Comment

      Working...