Session variables are not stored when set in implicitly called constructor!??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hallo everybody,
hope I am writing to correct mailinglist(^_^*)...
I have troubles with sessions and descructor in php5. Can not set session
variable in destructor when it's called implicitly. Do You know solution
please?
I think problem is that session is stored before imlicit object destruction
*doh*

example.php:
<?php
session_start();
session_register("variable");

// singleton for request
class Request {
    function __destructor() {
        $_SESSION["variable"] = "hallo";
    }
}

$req = Request::getInstance();
$req->doSomeThink();
echo "This should be hallo 2nd time: " . $_SESSION["variable"];    //
unfortunatly this is not set
echo " <a href='example.php'>Click and cry;-(</a>";
// implicit desturctor call
?>

Thank You very much...
BR
a3c

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux