NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP $_SESSION

Tim Sailer sailer at bnl.gov
Thu Jun 5 14:15:23 EDT 2008


On Thu, Jun 05, 2008 at 11:05:35AM -0700, Néstor wrote:
> To answer the last 3 postings
> 
> I get the session_id() and save it in $_SESSION['mysession']
> then in every page I compare them if not the same then I send the user back
> to
> the login page:
>   if($_SESSION['mysession'] != session_id() ){
>      // redirect to the HR admin page
>      header("Location:/login.php");
>   }
> 
> The redirect works!!!
> 
> YES!    $_SESSION['mysession'] is empty,  the session information is
> disappearing
> from one page to the other.

Are you doing a session_start()?

Tim



More information about the talk mailing list