session_destroy requires two pages?
Posted: Tue Sep 23, 2008 6:18 am
I originally had the problem of Warning: Trying to destroy uninitialized session so I changed my code to the following...
header.php
...now when I load another page the user is still signed in until the second page after signing out.
I'm just trying to make this dead simple: page 1 + signed in == page 2 appears signed in. Page 2 + sign out == page 3 == appears signed out.
I've been messing with sessions for so long though only this morning decided to add a sign out link.
header.php
Code: Select all
session_name("member");
session_start();
if (isset($_GET['signout'])) {session_destroy();}I'm just trying to make this dead simple: page 1 + signed in == page 2 appears signed in. Page 2 + sign out == page 3 == appears signed out.
I've been messing with sessions for so long though only this morning decided to add a sign out link.