php - Test if session is started -


How do you check whether sessions are started or not? This is not the way ...

  session_start (); If (isset ($ _ session)) {echo "sessions"> 
} And {echo "session closed
"; } Session_destroy (); If (isset ($ _ session)) {echo "sessions">
} And {echo "session closed
"; }

Try it out:

if (session_id ())


Comments