Re: plz check the warning message

From: Date: Fri, 10 Aug 2001 10:43:23 +0000
Subject: Re: plz check the warning message
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-62153@lists.php.net to get a copy of this message
On Fri, Aug 10, 2001 at 04:08:19PM +0530, Balaji Ankem wrote: > Hi, munnik, > > thankyou for u'r help. > > I am getting the following warning while closing session. > > > Warning: Trying to destroy uninitialized session in c:\www\logout.php on line 3 > session closed for 85744 > > > Plz do the needful. I am sending the following files. > > > > logout.php > > <?php > session_unregister(emp_id); > session_destroy(); > echo "session closed for $emp_id"; > ?> > <!DOCTYPE (...) > (...) </HTML> > I just gave a quick look, but I think you forgot (or didn't know to) add session_start() to your code. So it will be: <?php session_start(); /* <-- This is it! */ session_unregister(emp_id); session_destroy(); echo "session closed for $emp_id"; ?> <!DOCTYPE (...) (...) </HTML> Otherwise you don't have any session to destroy... -- * R&zE: -- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze@datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- H: +31 23 5516190 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- -- http://www.datalink.nl -- ««««««««««««««««««««««««

« previous php.general (#62153) next »