Jump to content

Help with Sessions


lalnfl

Recommended Posts

<?php

 

if($_SESSION['session_count'] == 0) {

 

$_SESSION['session_count'] = 1;

$_SESSION['timeout'] = time();

 

}

 

else {

 

$_SESSION['session_count'] = $_SESSION['session_count'] + 1;

 

}

 

// 10 minute in seconds

$inactive = 600;

 

$session_life = time() - $_SESSION['timeout'];

 

// connect to database

include_once ("Scripts/mysql_db_connect.php");

 

 

 

if ($session_life > $inactive) {

 

$sql_logged_out = mysql_query("UPDATE Member SET logged_in='lo' WHERE id='$id'");

 

session_unset();

session_destroy();

 

}

 

$_SESSION['timeout'] = time();

 

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.