internet explorer - PHP header redirection issue: Not going where it should -


i have admin page in app i've developed allows users logged in site admin click link automatically log in specific user (bypassing password entry).

once app has set necessary session variables log in chosen user, there's block of code looks this:

if ($login->loginasuser($_post['selecteduser']) === true) {     //redirect user page     error_log ("redirect user.php");     //die("breakpoint 1");     header("location: user.php");     exit; } else {     die("login error"); } 

(it's ok - i'm validating post variable before this).

$login->loginasuser(id) method of login class. destroys current session , creates new 1 user login, , returns true if ok.

as can see, i've added code write message apache error log before redirect. message appears correctly in log every time code runs. 90% of time happens redirect index.php, not user.php. also, mis-redirection seems occur in internet explorer (version 11 , previous versions), , happens 90% of time. once in while, redirect correct page.

what's weirder if uncomment line die("breakpoint 1");, browser still redirects index.php, rather halting , displaying message.

i've tried using absolute path redirect, doesn't improve anything.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -