NYCPHP Meetup

NYPHP.org

[nycphp-talk] preventing randomized session variable from changing when page is refreshed

Michael B Allen ioplex at gmail.com
Wed Aug 20 17:18:47 EDT 2008


On Wed, Aug 20, 2008 at 3:56 PM, Kristina Anderson
<ka at kacomputerconsulting.com> wrote:
> That's what I want to do, but I need to prevent the value of session id
> from changing if for some reason they revisit or refresh the index.php
> page...as that is where the value is created.

The session id should not change for the duration of the client's
visit. In your index.php you should do session_start() and that's it
(unless the user "logs out" in which case you might do
session_regenerate_id() to effectively destroy any session state).
What are you doing that is causing the session_id() to return a
different value when the user refreshes the page?

Mike



More information about the talk mailing list