|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-12-13 07:47 UTC] martin at netconfigs dot com
Session saved from globals dispite setting register_globals=off although session_encode() does what is expected.
.htaccess:
php_flag register_globals off
php-script resulting in session file: "count|i:4321;"
<?php
session_register("count");
$HTTP_SESSION_VARS["count"]=1234;
$count=4321;
?>
php-script resulting in session file: "!count|"
<?php
session_register("count");
$HTTP_SESSION_VARS["count"]=1234;
?>
workaround - last line of script:
while(list($k,$v) = each($HTTP_SESSION_VARS)) ${$k} = $v;
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 12:00:01 2025 UTC |
alternative workaround to tie the global and the HTTP_SESSION_VARS item together: while(list($k,$v) = each($HTTP_SESSION_VARS)) ${$k} = &$HTTP_SESSION_VARS[$k]; this causes changes to the global to be reflected in the HHTP_SESSIONS_VARS array - and vice-versa