Jump to content

Recommended Posts

In the code for a website we use, the logout sequence in class.inc.php is set to destroy the current session but leave the user on the existing URL. 

 

Below is the logout code in the class.inc.php.  Everything works and the normal function would be to exit on the starting login page and wait for them to login again.  I need to change the redirect to take the User to our Main page rather than staying on the URL where they logged out.
 
I am not familiar with PHP But I think if i edited the current redirect line to send the user to the new location it should do it.  If anyone could tell me where to add the 'http://www.newsite.com' address I would appreciate it.
 
 
     function logout() {
 
     $_SESSION["user_id"]   = null;
     $_SESSION["user_role"] = "Visitor";
     session_destroy();
 
     redirect("$_SERVER[php_SELF]?interface=login;
 
return true;

This line:

 

 

redirect("$_SERVER[php_SELF]?interface=login;

 

Is not valid code. And "redirect" is not a php command. Perhaps there is a function somewhere in your code called redirect. In that case show us that as well as a corrected line above.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.