lifelineamerica
Programmer
This seems so silly but its driving me nuts!
I redirect people who reached a page they shouldn't have. So if the session I am looking for is not there, they are redirected back to the page with variable ks=1 set (ks as in kill session)
I have this condition in the home page where if they have been redirected to it as above with the ks set to 1 I want to destroy all session, so...
Doing that, I get the error :
Warning: session_destroy(): Trying to destroy uninitialized session
So I add session_start(); to the condition as so...
and I get the following error: Notice: A session had already been started - ignoring session_start()
What the #$%^%&? Does it find a session or does it not? Its not happy either way with me !!!!
I redirect people who reached a page they shouldn't have. So if the session I am looking for is not there, they are redirected back to the page with variable ks=1 set (ks as in kill session)
I have this condition in the home page where if they have been redirected to it as above with the ks set to 1 I want to destroy all session, so...
Code:
//keep the session going
//but I condition it otherwise got error that it exists
if(!isset($_SESSION))
{
session_start();
}
if ((isset($ks))&&(isset($_SESSION)))
{
session_destroy();
}
Doing that, I get the error :
Warning: session_destroy(): Trying to destroy uninitialized session
So I add session_start(); to the condition as so...
Code:
//keep the session going
//but I condition it otherwise got error that it exists
if(!isset($_SESSION))
{
session_start();
}
if ((isset($ks))&&(isset($_SESSION)))
{
[b]session_start();
[/b]session_destroy();
}
and I get the following error: Notice: A session had already been started - ignoring session_start()
What the #$%^%&? Does it find a session or does it not? Its not happy either way with me !!!!