Saturday, September 12, 2015

Session ID in PHP

If a session is already started or if you want to check if a session have started or is active/valid then you can check in the following way.

session_start();
$session_id = session_id();

if($session_id){
echo "Session is Vaild and ID is: ".$session_id;
}
else{
echo "No Session have started";
}

No comments:

Post a Comment

MS SQL : How to identify fragmentation in your indexes?

Almost all of us know what fragmentation in SQL indexes are and how it can affect the performance. For those who are new Index fragmentation...