note 36590 added to function.session-id
| From: | Cybertinus at rn2 dot php dot net | Date: | Wed, 15 Oct 2003 17:28:44 +0000 |
| Subject: | note 36590 added to function.session-id | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-58648@lists.php.net to get a copy of this message | ||
As of php 4.3.3 you get a notice when you start an session twice. You can use session_id() to detect
if a session is already started. Before you can make a script, you must know that session_id()
returns false when no session ID is known. So now we can make a script witch dectect if a session is
started, and if it is not, it startes an session. This is what you get then:
<?php
if(!session_id()){
session_start();
}
?>
I hope somebody can use this information.
Greetz, Cybertinus
----
Manual Page -- http://www.php.net/manual/en/function.session-id.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+36590
Delete -- http://master.php.net/manage/user-notes.php?action=delete+36590&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+36590&report=yes
Search -- http://master.php.net/manage/user-notes.php