title: When does a web server clear the PHP session identifier?
body: <p><strong>Background:</strong></p>
  
  <p>I am trying to write a script that connects on a regular basis to a web server and checks if some information on a specific page was changed. I already got this working using a combination of bash (for scripting), curl (for the actual connection) and crontab (for the scheduling). </p>
  
  <p>Since the server requires authentication, I first used curl to do a POST request on the login page with my credentials and saved the cookie file (containing the PHPSESSID). Now i can use the cookie file when doing the request for the actual web page I want to check. </p>
  
  <p><strong>Question(s):</strong></p>
  
  <ol>
  <li><p>When does the server actually clear the PHPSESSID i set with my first request? I imagine it must do this sometime, otherwise it would crash because it keeps storing information about every single session that was ever started.</p></li>
  <li><p>If the PHPSESSID is cleared on closing the browser is there some way i can simulate that even using curl?</p></li>
  </ol>