Reputation: 1541
I'm implementing facebook app in symfony. I used facebook php SDK
When I call
$me=$facebook->api("/me");
if(isset($me['id']))
$response=$facebook->api("/".$me['id']."/notifications",
"POST",
array (
'access_token'=>$accesstoken,
'href' => 'notification',
'template' => $message,
));
In Symfony action I'm getting:
Failed to start the session: already started by PHP ($_SESSION is set)
How can I solve this issue?
Upvotes: 0
Views: 771
Reputation: 1771
Add this line of code right after the initialization of $me var.
$session = $this->get('session');
$session->start();
Upvotes: 1
Reputation: 15457
You add a @ sign in from of session_start()
to suppress the error. This way, you can keep the line of code incase the session wasn't previously started, but the error will be hidden in case it was already started:
@session_start();
Upvotes: 0