Jump to content

Log out redirect to new URL in class.inc.php


questorfla

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;

Link to comment
Share on other sites

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.