note 119841 added to function.session-destroy
| From: | Gaurav | Date: | Mon, 05 Sep 2016 06:08:45 +0000 |
| Subject: | note 119841 added to function.session-destroy | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-206495@lists.php.net to get a copy of this message | ||
For session_destroy() only destroy current session mean that if you specify name or change the save
path of session etc ,it will not destroy it mean for example
create.php
<?php
session_name('testing') ;
session_start() ;
$_SESSION['id'] = '35' ;
?>
delete.php
<?php
session_start() ;
session_destroy() ;
?>
session_destroy only delete the new session which is created by session_start(). correct way is
<?php
session_name('testing') ;
session_start() ;
session_destroy() ;
?>
this is also valid for if you change session.save path throught ini_set() , you have to mention in
delete.php.
remember session_destroy() function destroy only current session not all .i hope this is worth to
mention.
----
Server IP: 72.52.91.14
Probable Submitter: 14.139.240.251
----
Manual Page -- http://php.net/manual/en/function.session-destroy.php
Edit -- https://master.php.net/note/edit/119841
Del: integrated -- https://master.php.net/note/delete/119841/integrated
Del: useless -- https://master.php.net/note/delete/119841/useless
Del: bad code -- https://master.php.net/note/delete/119841/bad+code
Del: spam -- https://master.php.net/note/delete/119841/spam
Del: non-english -- https://master.php.net/note/delete/119841/non-english
Del: in docs -- https://master.php.net/note/delete/119841/in+docs
Del: other reasons-- https://master.php.net/note/delete/119841
Reject -- https://master.php.net/note/reject/119841
Search -- https://master.php.net/manage/user-notes.php