SESSION Logins
Posted: Tue Oct 12, 2010 6:40 am
Hi,
I created a login system for the project that I am working on. I use a Session class that I created to log users in.
The login method of the Session class looks like this:
Everything is working fine. Login. Logout no problems.
But, I created another project, using the same class (a new session class for that project) and technique to login. And that's where the problem comes in.
I have project 1 open in a tab. And I login using database 1. Then I open project 2 in another tab, which uses a different database, and then project 2 automatically redirects me to the page after login. It doesn't ask me to login in project 2. Is this because of a session value that has been set or how does this work?
Please excuse my ignorance.
Any help would be appreciated.
Thanks
I created a login system for the project that I am working on. I use a Session class that I created to log users in.
The login method of the Session class looks like this:
Code: Select all
public function login($user)
{
$this->user_id = $_SESSION['user_id'] = $user->id;
$this->logged_in = true;
}
But, I created another project, using the same class (a new session class for that project) and technique to login. And that's where the problem comes in.
I have project 1 open in a tab. And I login using database 1. Then I open project 2 in another tab, which uses a different database, and then project 2 automatically redirects me to the page after login. It doesn't ask me to login in project 2. Is this because of a session value that has been set or how does this work?
Please excuse my ignorance.
Any help would be appreciated.
Thanks