Where are you echoing the session variable?
You should try echoing it right at the top.
Maybe you're overwriting with $_SESSION['email'] = $email;
Where $email will be empty on the second load of the page.
Try something like...
[php]
if ($_SESSION['email']) {
// session is set, check if valid
} else {
// session not set, ask for login
}
[/php]
Something to note:
sessions are available on the second load, after you set it.
(thats the reason we have it, continuity in a stateless protocol, http)
they dont always work, if cookies are not accepted by the browser, and your php ini only allows 'safe' sessions, where it isn't passed in the url, sessions will fail.
digital-ether
Nearly a Posting Virtuoso
1,293 posts since Sep 2005
Reputation Points: 461
Solved Threads: 101
digital-ether
Nearly a Posting Virtuoso
1,293 posts since Sep 2005
Reputation Points: 461
Solved Threads: 101