How to make URL loads only on login

Posted on 16th Feb 2014 by admin

On my page, when a user login he's redirects to user_home.php. I made it also to open the chat screen when the user login.
This is the code:
Code: // USER IS LOGGED IN, FORWARD TO USER HOME
if( $user->user_exists )
{
header("Location: user_home.php");
header("javascript:launchChat();");
exit();
}
The problem is that every time, the user open user_home.php, the chat screen reloads (the user is loged out and loged in to the chat).
How to make the chat screen loads ONLY THE FIRST time, when the user login?

Other forums