Re: session_id() is not passed to the next page
| From: | Adam Richardson | Date: | Tue, 04 Jan 2011 05:14:30 +0000 |
| Subject: | Re: session_id() is not passed to the next page | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-310479@lists.php.net to get a copy of this message | ||
On Mon, Jan 3, 2011 at 11:46 PM, Michelle Konzack <
linux4michelle@tamay-dogan.net> 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