hi,
i've been trying to unregister a session object by using session_unregister but it won't work...
i've created a class called JournalInfo saved in JournalInfo.php:
Class JournalInfo {
var $title;
var $shorttitle;
function setTitle($title) {
$this->title = $title;
}
function getTitle() {
return $this->title;
}
function setShortTitle($shorttitle) {
$this->shorttitle = $shorttitle;
}
function getShortTitle() {
return $this ->shorttitle;
}
}
i used this class on file1.php to hold data:
<?
session_start();
header("Cache control: private");
include JournalInfo.php;
$journal = new JournalInfo();
$journal->setTitle("Journal Name");
$journal->setShortTitle("Journal");
$serJournal = serialize($journal);
session_register("serJournal");
?>
i then retrieved the object on file2.php:
<?
session_start();
header("Cache control: private");
include JournalInfo.php;
$journal = unserialize($serJournal);
$title = $journal->getTitle();
$shorttitle = $journal->getShortTitle();
session_unregister("serjournal");
?>
when i access file3.php:
<?
session_start();
header("Cache control: private");
if (session_is registered("serjournal")) {
echo "Session is registered";
} else {
echo "Session is not registered";
}
?>
it would produce
Session is registered.