title: How long will a session variable last if you don't unset it?
body: <p>When I store a variable in a session (in php), how long will that variable linger in that file? Will it be there until someone unsets the variable or deletes the file?  </p>
  
  <p><strong>update:</strong> so it is <a href="http://www.php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime" rel="nofollow noreferrer">session.gc-maxlifetime</a>  setting that is set in php.ini file. You can check  your setting by calling phpinfo().  Mine is set to 1440 seconds so 24 minutes. <a href="https://stackoverflow.com/questions/156712/php-what-is-the-default-lifetime-of-a-session">Might have found a duplicate here</a>, although when googling I didn't find it at first because of the wording.</p>