i have a third party script and was wondering how i can check with php if session_start() has been declared before doing something?
something like if(isset($_session_start())) { //do something }
i have a third party script and was wondering how i can check with php if session_start() has been declared before doing something?
something like if(isset($_session_start())) { //do something }
I suppose you could use the session_id function :
session_id()returns the session id for the current session or the empty string ("") if there is no current session (no current session id exists).
Or maybe testing whether $_SESSION is set or not, with isset, might do the trick, as it should not be set when no session has been started -- you just have to hope that nothing assigns anything to $_SESSION without starting the session first.