Welcome Guest, Not a member yet? Register   Sign In
still losing session userdata across a redirect
#25

(12-04-2017, 08:58 PM)skunkbad Wrote: I use PHP's header function, which does not use exit. Years ago I was having problems with a redirect and session combination, and I read somewhere that the redirect needs to be done before the session write, so I've been doing it that way ever since. That's all I know, and if it's wrong then I don't know much Smile

My assumption - that you were using the CI helper function redirect() - was the source of my confusion.

I don't know if it's right or wrong but if it works then who am I to blow against the wind?  That said, I'm at a complete loss as to how doing this

PHP Code:
header('Location: http://www.mysite.com/someotherpage.php');
$_SESSION['item'] = 'xyz'

would produce results different than this

PHP Code:
$_SESSION['item'] = 'xyz';
header('Location: http://www.mysite.com/someotherpage.php'); 
Reply


Messages In This Thread
RE: still losing session userdata across a redirect - by dave friend - 12-05-2017, 12:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB