New in PHP 5.4 adds the ability to judge the session state
In previous versions of PHP, to determine if the session is valid, you can use the following method:
Session_Start (); if (Isset ($_session)) { echo "Started"; } else { echo "not Started"; }
In PHP 5.4 (coming soon), the status of the session is subdivided, which can be judged by the following methods:
Session_Start (); $status = Session_status (); if ($status = = php_session_disabled) { echo "SESSION is DISABLED"; } else if ($status = = Php_session_none) { echo "session Enabled but No SESSION values Created"; } else { echo "session Enabled and Session values Created"; }
You can see that by using Session_status (), a value of type int is returned, indicating the various states of the session, such as prohibitions (php_session_disabled), the session does not exist
(Php_session_none)
, or the SESSION has been set up (php_session_active)
1/F Lijichao 2012-02-20
2/F mailangel123 2012-02-21
This can have.
3/F mailangel123 2012-02-21
[Color=red] [/color] [/align] [/size][align=center]
[/align] [Align=right]
[Size=x-small]
[Align=left] [/align]