Sessions in classes dosn't work!?

From: Date: Thu, 30 Aug 2001 09:10:54 +0000
Subject: Sessions in classes dosn't work!?
Groups: php.general 
Request: Send a blank email to php-general+get-65185@lists.php.net to get a copy of this message
How come that I cannot store a varible in the session when I do this from within another object? This is my code: ******************************************** <?php session_start(); class MyClass { function MyClass($state) { if($state == "page2") { print("[" . $foo . "]"); session_destroy(); } else { session_register("foo"); $foo = "Hello World!"; print("<a href=\"?state=page2\">Click here</a>\n"); } } } new MyClass($state); ?> ******************************************** /watson

« previous php.general (#65185) next »