Welcome Guest, Not a member yet? Register   Sign In
Sessions Created Before Logging In
#4

[eluser]WanWizard[/eluser]
A session is created as soon as you load the session library.

I don't see why that is a problem, as I wrote before the session itself has nothing to do with a 'logon', sessions are just a mechanism to carry information from one page request to the next.

You need this for authentication, you need to be able to determine if a user is logged in, so you can restore the users logged-in state at the next page request. So the session needs to be there, even if no user is logged in.

You need logic like:
Code:
if ( $this->your_library->restore_user_session() )
{
    echo "user is currently logged in";
}
else
{
    if ( $this->your_library->login() )
    {
        echo "new user logged in";
     }
     else
    {
        echo "no user is logged in";
    }
}
}


Messages In This Thread
Sessions Created Before Logging In - by El Forum - 04-04-2010, 09:52 AM
Sessions Created Before Logging In - by El Forum - 04-04-2010, 10:07 AM
Sessions Created Before Logging In - by El Forum - 04-04-2010, 03:21 PM
Sessions Created Before Logging In - by El Forum - 04-05-2010, 02:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB