In php I want to check if the user is logged in. Usualy it is done like this
if (isset($_SESSION['user_name'])
The question is. Is it necessary to start session ( write session_start() in the code ) before this check? Or is it possible to check session var without starting a session?
As you see all the answer there is no way to get the
session variableswithout using thesession_start()then it is must to use
session_start()before checking any session variable,also if you using
if(isset($_SESSION['username']))it will only work when you start the session before