title: Should I use Session variables or the global supervariable
body: <p>I have a small situation here but I wanted to try and be sure I was approaching this in a correct way.</p>
  
  <p>I have a web application that is used by several shops.
  Each shop is authenticated through htaccess and htpasswd in order to connect to the correct database.
  This portion works great!</p>
  
  <p>Each shop has multiple employees but each employee uses a separate computer/workstation.</p>
  
  <p>So it goes Shop logs in, gets authenticated, connects to proper database and then loads a login page.</p>
  
  <p>At the login page the user logs into the application using name and password, and they are good to go.
  At this point I am loading user information (UserID, Security Level, etc) into the session.
  Part of my problem is trash collection as every once in awhile the session variables are getting lost.
  Every page has session start as the first thing so I imagine after an hour or so of inactivity the session is getting collected by the trash collector and poof, it is gone.</p>
  
  <p>I am toying with the idea of loading the user information into the <code>$GLOBALS</code> supervariable to avoid losing the session due to inactivity.
  Now, I realize that there are ways to delay/stop the trash collector in PHP but it seems to me if I use the global scope it removes the need for extra coding or configuring of PHP.
  Am I correct in assuming that as long as each user is on their own machine accessing the site that using the <code>$GLOBALS</code> will only apply to each user?</p>