I made a question today about sessions, so finaly i resolved my problem with it. But now after i start my session and:
header('Location: main.php');
it redirects mi to this main.php file but whe i ask in this very file:
if (!isset($_SESSION['uname'])) {
echo '<script type="text/javascript">alert("not set");</script>';
}
i get answer not set.Why ? i have set my session. why after redirect when i ask about the existence of this session it says it doesnt exist ?
in every file where you are using session you need to start session.
session_start();
it seems that you have missed that in main.php.
Add this line at the top of every php page where you are using session.