In php5.4, the new function for judging session Status & nbsp; in previous php versions, to determine whether a session is valid, you can only use the following method: session_start (); if (isset ($ _ SESSION) {echoStarted;} else {echoNotStarted;} & nbs php 5.4 adds the session status judgment function
In previous php versions, you can only use the following method to determine whether the session is valid:
session_start(); if(isset($_SESSION)) { echo "Started"; } else { echo "Not Started"; }
In php 5.4 (coming soon), the session status is subdivided and can be determined using the following method:
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"; }
As you can see, the returned value of the int type by using session_status () indicates the various statuses of the session, such as disable (PHP_SESSION_DISABLED). The session does not exist.
(PHP_SESSION_NONE)
Or the session has been established (PHP_SESSION_ACTIVE)
1 floor lijichao 2012-02-20
2 floor mailangel123
This can be.
3 Floor mailangel123 2012-02-21
[Color = red] [/color]
[/Align] [/size] [align = center]
[/Align] [align = right]
[Size = x-small] [align = left] [/align]