impossible to read $_SESSION vars on PHP facebook

2019-09-14 22:42发布

impossible to read $_SESSION vars on PHP facebook app. When this happens the facebook->getUser method returns 0. This is driving me mad...There's a lot of literature around the web but it seems that no one has found what causes this problem. I've stated that sometimes when you load the page $_SESSION vars seem to have disappeared. I'm not only talking about the facebook session, when getUser returns 0, all session vars (even the ones I initialized before) are not set anymore. Anyone has a clue of why is this happenning or how to solve it?

标签: php facebook sdk
1条回答
神经病院院长
2楼-- · 2019-09-14 22:56

Did you remember to call session_start() on the pages that are giving you trouble? Without this, $_SESSION vars won't be initialised.

查看更多
登录 后发表回答