View Single Post
Old 09-21-2007, 10:13 AM   #7 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

The session_regenerate_id function replaces the current session id with a new one, whilst keeping all of the session data intact. It is that part which is helping to prevent the problem of "session hijacking".

Your auth (authorisation and authentication combined) code, Tanax, will work just fine. Personally I'd go for the negative check with a redirect to a login page.
PHP Code:
if ( ! $auth->check())
{
    
header('Location: full_url_to_login_page');
    exit;
}


... 
rest of page's code ... 
Salathe is offline  
Reply With Quote