Are you sure that you are getting a fresh session?  If the alter_session()
method was ever run in the past on that same session, then its values will
remain the same for all future requests for that session.

As others have suggested, the only other thing I can think that could be
happening is that the alter_session() method is being called somehow by the
include_once() call.  A simple debugging tip to figure out how it is getting
called is to temporarily modify the alter_session() method and add
debug_print_backtrace(); to the top of the method.  This will show you a
stack trace of all of the function calls leading up to it.


On Fri, May 27, 2011 at 11:26 AM, Wade Preston Shearer <
[email protected]> wrote:

> I have a script like this:
>
>
> include_once('pancake.class.php');
>
> print_r($_SESSION);
> die;
>
> $pancake = new Pancake();
> $pancake->alter_session();
>
>
> The alter_session() method makes changes to the session. When I print out
> the session and then exit a few lines above however the alterations have
> already occurred.
>
> How could this be happening?
>




_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to