Re: session_id() is not passed to the next page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 3, 2011 at 11:46 PM, Michelle Konzack <
linux4michelle@xxxxxxxxxxxxxxx> wrote:

> ...
>    session_register('sess_user');
>    session_register('sess_timeout');
>    $sess_user    = $user;
>    $sess_timeout = time() + 900;
>    session_write_close();
>    header("Location: " . $redirect);
>  }
>  exit();
> }
> ----8<------------------------------------------------------------------
>
> which call the following page correctly, but the two vars $sess_user and
> $sess_timeout are empty.
>

session_register() registers global variables, but you're inside a function.

Set the session values using this technique instead:

$_SESSION['sess_timeout'] = time() + 900;

Adam

-- 
Nephtali:  A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux