Delete session data after 2 min in php -


i'm newbie in php , have question. example have in session array variable call game_url:

$_session['game_url'] = $_server['http_referer']; 

is possible make $_session['game_url'] = ''; after 2 min after has set? appreciated.

if (!isset($_session['game_url'])) {     $_session['last_activity'] = time();     $_session['game_url'] = $_server['http_referer']; } if (isset($_session['last_activity']) && (time() - $_session['last_activity'] > 120))  {     unset($_session['game_url']);     unset($_session['last_activity']); } 

Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -