Re: [PHP] Stopping objects from auto-serializing
- From: deceze@xxxxxxxxx (David Christopher Zentgraf)
- Date: Wed, 31 Oct 2007 17:04:26 +0900
After some more playing around and a lot of print_r($SESSION)'s:
This specific PHP configuration seems to replace every entry in $_SESSION if a variable with the same name is used in the main script with that variable.
I.e.
session_start() // $_SESSION["foo"] is now "bar"
$foo = "12345";
$var = "xxxx";
function test() {
$foo = "67890";
}
test();
After execution finished $_SESSION["foo"] is now "12345", but there's no $_SESSION["var"].
What's going on here?
On 31 Oct 2007, at 16:25, David Christopher Zentgraf wrote:
.
On 31 Oct 2007, at 16:16, Jochem Maas wrote:
are you using session_register()? (dont)
also are you setting the value in $_SESSION by reference?
No and no. The only time I'm writing to $_SESSION["basket"] is by setting $_SESSION["basket"][] = "foo", I'm never touching the actual $_SESSION["basket"] variable as such, but which is exactly what's happening.
- References:
- Stopping objects from auto-serializing
- From: David Christopher Zentgraf
- Re: [PHP] Stopping objects from auto-serializing
- From: Jochem Maas
- Re: [PHP] Stopping objects from auto-serializing
- From: David Christopher Zentgraf
- Re: [PHP] Stopping objects from auto-serializing
- From: Jochem Maas
- Re: [PHP] Stopping objects from auto-serializing
- From: David Christopher Zentgraf
- Stopping objects from auto-serializing
- Prev by Date: Re: [PHP] Stopping objects from auto-serializing
- Next by Date: Re: Stopping objects from auto-serializing
- Previous by thread: Re: [PHP] Stopping objects from auto-serializing
- Next by thread: Re: Stopping objects from auto-serializing
- Index(es):
Relevant Pages
|