Up to PHP 5.3 we do not have any proper/core function which checks the status of the session.
Here status means, We have called the session_start() function but we wants to make sure that really session is started or not. So this status check function is not available upto PHP 5.3.
So up to PHP 5.3 if we want to check the status of the Session then we have to use below code.
Right now we can use below block code to check if session is started or not.
In PHP 5.4 we have native function which provide us the status of the session either it is started or not. This function is session_status().
This function does not take any parameter and it will return the integer based on the session status.
Have a look at the below code block which shows the use of this function.
In PHP 5.4 with this function session_status() we will have three new constants available which provides the different status of the session.
Here are those status constants:
From PHP 5.4 we will have a native function which is session_status() and also we will have 3 status for the same.
Avinash Zala is leading various projects which deals with the various technology involved with the web. A combination of perfect technical and management skills. Avinash would like to chat with you and convert your imagination into the working system. You can get in touch with him on Facebook and Twitter.
View all posts by: Avinash