Saturday, 17 August 2013

Check if session doesn't exist php

Check if session doesn't exist php

I have the following php code :
<?php
if (!(session_id('password')) || !(session_id('user_name'))) {
header("Location: ../../"); /* Redirect browser */
}
?>
Which should check if session doesn't exist, and if it doesn't, the user
redirects, the problem is that this condition is always true, even when
the session does exists, my question is how can I fix it?

No comments:

Post a Comment