php - header() function not working after $_SESSION -
i have big issue , can't solve it. made simple login script , worked on laptop's lamp server. happy , uploaded host, there couldn't log in. solved header() not working after $_session. current test code without login , everything:
<?php session_start(); $_session['test'] = 10; header("location: anything.php"); ?>
and doesn't redirect. problem?
the problem headers have been send. is, session_start
sends out several http headers. http://php.net/manual/en/function.session-start.php:
this function sends out several http headers depending on configuration. see session_cache_limiter() customize these headers.
try turning warnings , errors on (this should give warning) error_reporting(-1);
. doing during development practice anyway.
if it's not that, must sending output before header. although, looking @ example code gave, that's not case.
see this nicely answered question more information problem.
Comments
Post a Comment