Reputation: 28799
i have a site, with many tabs , when i open any tab i want to get some data from session, but that data can't be got without session_start();
and when i put session_start()
, an exception thrown tell me that the session is already starts
this is the exception
A session had already been started - ignoring session_start()
Upvotes: 1
Views: 69
Reputation: 987
You should check to see if the session is set before starting the session.
if(!isset($_SESSION)){
session_start();
}
Upvotes: 1
Reputation: 6355
You can begin with
if(!$_SESSION) {
session_start();
}
or,
@session_start();
The "@" supresses errors.
Upvotes: 1