al3x8730 Posted August 24, 2008 Share Posted August 24, 2008 Well I own the website: http://imshare.us.to and I've been having a problem, I noticed that when users logged in they're just getting logged out. So I added header('Refresh: 1; url=http://imshare.web44.net/profile.php' ); To the login file: <?php // config include_once "../config.php"; // controllers switch($_REQUEST['action']) { case 'submit': if($member_id = verifyLogin($_REQUEST['email'], $_REQUEST['password'])) { $messages = array("return" => "success", "message" => "Successfully signed into your account!"); // set session hash $member = getMemberById($member_id); $_SESSION['sessionhash'] = ( sha1( $member['id'] ) . sha1( $member['password_salt'] ) . sha1( SESSION_SALT ) ); header('Refresh: 1; url=http://imshare.web44.net/profile.php' ); } else { $messages = array("return" => "error", "message" => "You provided incorrect details"); } $smarty->assign("messages", $messages); break; default: // show register form } // view $smarty->display( "login.tpl" ); ?> Now that fixed it in Opera. Now it redirects to the profile page of the user, no problem. But in IE it just logs the person out, and keeps them at the login page. Maybe this isn't the most efficent way to do what I want to do? Redirection without logging the user out in all web browsers. Thanks^^. Link to comment https://forums.phpfreaks.com/topic/121071-solved-refreshingredirecting-without-logging-out-ie/ Share on other sites More sharing options...
JasonLewis Posted August 24, 2008 Share Posted August 24, 2008 I've never used a header() like that: Try like this: header("Location: profile.php"); Link to comment https://forums.phpfreaks.com/topic/121071-solved-refreshingredirecting-without-logging-out-ie/#findComment-624140 Share on other sites More sharing options...
al3x8730 Posted August 24, 2008 Author Share Posted August 24, 2008 I've never used a header() like that: Try like this: header("Location: profile.php"); Still doesn't work on IE. It just brings me to the homepage. And not logged in. :| I would also like it to wait a few seconds because I have a little "you've been suscesfully logged in" kinda thing, but if this problem can't be solved with a waiting thing, whatever I just want this fixed :| Link to comment https://forums.phpfreaks.com/topic/121071-solved-refreshingredirecting-without-logging-out-ie/#findComment-624149 Share on other sites More sharing options...
JasonLewis Posted August 24, 2008 Share Posted August 24, 2008 If you want it to wait, look at the HTML meta refresh. Why is it logging you out? I don't understand. Glimpsing at your code, it shouldn't be logging you out as soon as you log in. Link to comment https://forums.phpfreaks.com/topic/121071-solved-refreshingredirecting-without-logging-out-ie/#findComment-624151 Share on other sites More sharing options...
al3x8730 Posted August 24, 2008 Author Share Posted August 24, 2008 If you want it to wait, look at the HTML meta refresh. Why is it logging you out? I don't understand. Glimpsing at your code, it shouldn't be logging you out as soon as you log in. I'm not sure :| Try it yourself. Make a quick account. Use IE with the code I was giving on here, watch what it does. It just logs me right out. Link to comment https://forums.phpfreaks.com/topic/121071-solved-refreshingredirecting-without-logging-out-ie/#findComment-624153 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.