How do you tell if a session has expired (in a secure manner) and redirect to the login page if it has?
The only way I can think of is to check one of the variables that should be registered with the session, for instance $MemberID, and if it is not registered, return to the login page. For instance:
if ( !session_is_registered("MemberID") )
{
header("Location: login.php");
exit;
}
Is this how you guys do it?
Also, would I have to necessarily check each variable to be registered with the session, or would this be an unnecessary security precaution?