• Home
  • Archives
  • Super Lamb Bananas
Subscribe: Posts | Comments | E-mail
  • Coding
  • Events
  • Gaming
  • Media
  • Myself
  • Photos
  • Places
  • School
  • Technology

Jordan Hatch’s Blog

Posts Tagged ‘sessions’


Posted on September 23, 2007 - by Jordan H

PHP Session Purging

I’ve been trying to make a login script that purges the sessions database so that users will only stay inactive for 1 hour until they have to log in again. All seems to be well, but then it just doesn’t work.

This is the code which I have on every page:

$time = date("ymdHis");
$cutoff = $time-1000;

$sql = "DELETE FROM adminsessions WHERE time<'$cutoff'";
mysql_query($sql) or die(mysql_error());

It should log the user out after 10 mins of inactivity. Doesn’t seem to be doing that at the moment. Anyone got any ideas?



  • Flickr Photos

  • Latest Tweets

    • Archives

      • September 2008
      • August 2008
      • July 2008
      • June 2008
      • May 2008
      • April 2008
      • March 2008
      • February 2008
      • January 2008
      • December 2007
      • November 2007
      • October 2007
      • September 2007
    • Tag Cloud

      • acegx big brother blackpool blog burnout content database dlc flickr games geekup inactive jhsystems liverpool login manchester modules newcastle office perl php ps3 script sessions single site sitemail smarty summer superlambanana system t-mobile television template theme twitter user users website windows wordcamp wordpress xbox 360 xewsletter x factor
    Copyright © 2006-8 Jordan Hatch
    Powered by WordPress