> Why would you want to create and destroy the session data during a single
> request? That simply doesn't make sense - session persistence is designed
> to keep registered session data available across _a_series_ requests.

This I know, but it was just to show what I wanted to do.

> I believe PHP chokes at session_destroy() since the session save file has
> not yet been created, and thus deleting the session data returns an error
code.

I first got the problem when I tried this tutorial at Zend:
http://www.zend.com/zend/tut/session.php

I found it funny that a tutorial about sessions had such a "bug", since it
was supposed to cover this feature.

Complete source can be downloaded here:
http://www.phpwizard.net/resources/tutorials/session_intro.html

I had to change some in your code (lines marked with >>)...

<?php
// removed $ from $isset
>> if (isset($value)) {
    echo "thanks";
    session_destroy();
}
else {
// These were below the echo before...
>>     session_start();
>>     session_register($value);
    $value = 12;
    echo "<form><input type=hidden name=value value=$value>";
    echo "input type=submit></form>";
}
?>

Error message: Warning: Trying to destroy uninitialized session in
E:\Inetpub\wwwroot\testscript\sessions\test.php on line 4

Just a thought...
Could it have anything with the session.save_path?
session.save_path         =e:\Temp\sessions

Regards,
// Tobias



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to