You are here: Re: $_SESSION / $HTTP_SESSION_VARS behaviour « PHP Programming Language « IT news, forums, messages
Re: $_SESSION / $HTTP_SESSION_VARS behaviour

Posted by Pedro Graca on 11/02/06 10:17

Michael Windsor wrote:
> For reasons I don't know, if the PHP version is 5 or greater,
> register_long_arrays is false and $_SESSION exists, the following
> statement is executed:
>
> $HTTP_SESSION_VARS = $_SESSION;

Probably the script was written for PHP version < (something) when the
superglobal arrays were not defined.
Instead of changing the script to use the "new" superglobal arrays, the
programmer chose to copy the $_SESSION array to the $HTTP_SESSION_VARS
and keep everything else referencing $HTTP_SESSION_VARS['index'].

> This line is stopping any subsequent changes to the $_SESSION variable
> from being stored in the session file on the server - changes can be
> made, but are all lost at the end of the page processing and the value
> reverts to whatever it was before the script was executed.

Check the very end of the script for a line

$_SESSION = $HTTP_SESSION_VARS;


--
I (almost) never check the dodgeit address.
If you *really* need to mail me, use the address in the Reply-To
header with a message in *plain* *text* *without* *attachments*.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация