Zubrag.com
June 19, 2018, 12:00:07 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Redirect with cookie set  (Read 9165 times)
carl2782
Newbie
*
Posts: 3


« on: December 13, 2009, 04:56:50 PM »

Hi everyone, love the script!

Can anybody help me, I'm trying to set up a site with this script and once someone is logged in and the cookie is set, if they then go to the homepage of the site again, login.php comes up with a blank page. I'm using login.php in a frame, do you think that would matter?

Cheers
Carl

Logged
carl2782
Newbie
*
Posts: 3


« Reply #1 on: December 13, 2009, 05:39:02 PM »

Just thought I might mention also, I have tried to modify the part of login.php which relates to verifying the cookie. I changed the end of the script to this:

 // check if cookie is good
  $found = false;
  foreach($LOGIN_INFORMATION as $key=>$val) {
    $lp = (USE_USERNAME ? $key : '') .'%'.$val;
    if ($_COOKIE['verify'] == md5($lp)) {
      $found = true;
      // prolong timeout
      if (TIMEOUT_CHECK_ACTIVITY) {
        setcookie("verify", md5($lp), $timeout, '/');
      header('Location: '
             . ((REDIRECT_PREFIX != '') && (strpos($REDIRECTS[$login], 'http') !== false) ? '' : REDIRECT_PREFIX)
             . $REDIRECTS[$login]);
      }
      break;
    }
  }
  if (!$found) {
    showLoginPasswordProtect("");
  }

}

?>
But that just seems to redirect me the homepage of the website, not to my users' page. If anyone wants to see where it's happening, it's at http://banffconcierge.6te.net
Logged
carl2782
Newbie
*
Posts: 3


« Reply #2 on: December 13, 2009, 06:48:04 PM »

Sorry to post 3 in a row, couldn't seem to delete or edit the other posts!

I've managed to get it to redirect me to the redirect prefix that is set in settings.php by having this:

header('Location: '
             . ((REDIRECT_PREFIX != '') && (strpos($REDIRECTS[$login], 'http') !== false) ? '' : REDIRECT_PREFIX)
             . $REDIRECTS[$login]);
      exit();

immediately below where it verifys the cookie in login.php. But I can't get it to redirect to the page set in users.php... Please help, I'm a bit of a rookie at this. Thanks!

Logged
zubrag
Administrator
Hero Member
*****
Posts: 786


WWW
« Reply #3 on: December 14, 2009, 03:00:49 PM »

Script should have been redirecting as is, no changers were needed. I think the problem is somewhere else. Did you change a login form? Could cause issues if changed incorrectly.
Logged
Olimpoyon
Newbie
*
Posts: 1


« Reply #4 on: December 17, 2009, 09:35:13 AM »

Hi, which is the definitive solution for this issue, blank page?

Thank you.
Logged
1ststop
Newbie
*
Posts: 30


« Reply #5 on: March 14, 2010, 05:37:19 AM »

Have you set the redirect_prefix parameter in settings.php?
This needs to be the full URL up to the the slash before the redirect page..

e.g.  page redirected to = welcome.php
redirect_prefix should be = http://siteaddress.com/

full page URL = http://siteaddress.com/welcome.php

The white page is a problem for nearly everybody who uses this script. It is best to always link to the login.php page using the logout parameter to always log a user out before returning to login.

e.g. link to login.php with = login.php?logout=1
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC