{"action":"created","issue":{"url":"https://api.github.com/repos/ParsePlatform/parse-php-sdk/issues/77","labels_url":"https://api.github.com/repos/ParsePlatform/parse-php-sdk/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/ParsePlatform/parse-php-sdk/issues/77/comments","events_url":"https://api.github.com/repos/ParsePlatform/parse-php-sdk/issues/77/events","html_url":"https://github.com/ParsePlatform/parse-php-sdk/issues/77","id":59532286,"number":77,"title":"User sessions between browser quit and open","user":{"login":"enricenrich","id":357265,"avatar_url":"https://avatars.githubusercontent.com/u/357265?v=3","gravatar_id":"","url":"https://api.github.com/users/enricenrich","html_url":"https://github.com/enricenrich","followers_url":"https://api.github.com/users/enricenrich/followers","following_url":"https://api.github.com/users/enricenrich/following{/other_user}","gists_url":"https://api.github.com/users/enricenrich/gists{/gist_id}","starred_url":"https://api.github.com/users/enricenrich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enricenrich/subscriptions","organizations_url":"https://api.github.com/users/enricenrich/orgs","repos_url":"https://api.github.com/users/enricenrich/repos","events_url":"https://api.github.com/users/enricenrich/events{/privacy}","received_events_url":"https://api.github.com/users/enricenrich/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-02T19:21:19Z","updated_at":"2015-03-02T20:07:06Z","closed_at":"2015-03-02T20:07:06Z","body":"Sorry for the title, but I wasn't able to explain better this problem. I have set up Parse PHP SDK on a web app, with the login working and logout too. The problem is that if I log in, then I close the browser and I open the web app, I'm not logged in.\r\n\r\nI'm pretty sure that it's something very easy to implement, but I don't have much experience on PHP. I would love if you help me!\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/ParsePlatform/parse-php-sdk/issues/comments/76803577","html_url":"https://github.com/ParsePlatform/parse-php-sdk/issues/77#issuecomment-76803577","issue_url":"https://api.github.com/repos/ParsePlatform/parse-php-sdk/issues/77","id":76803577,"user":{"login":"gfosco","id":406732,"avatar_url":"https://avatars.githubusercontent.com/u/406732?v=3","gravatar_id":"","url":"https://api.github.com/users/gfosco","html_url":"https://github.com/gfosco","followers_url":"https://api.github.com/users/gfosco/followers","following_url":"https://api.github.com/users/gfosco/following{/other_user}","gists_url":"https://api.github.com/users/gfosco/gists{/gist_id}","starred_url":"https://api.github.com/users/gfosco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfosco/subscriptions","organizations_url":"https://api.github.com/users/gfosco/orgs","repos_url":"https://api.github.com/users/gfosco/repos","events_url":"https://api.github.com/users/gfosco/events{/privacy}","received_events_url":"https://api.github.com/users/gfosco/received_events","type":"User","site_admin":false},"created_at":"2015-03-02T20:07:06Z","updated_at":"2015-03-02T20:07:06Z","body":"Store the Parse User in the $_SESSION variable, so you can load it later.  Use PHP Sessions.  Require the Parse SDK and then start a session with: `session_start();`\r\n\r\nWhen logging in:\r\n\r\n```\r\ntry { \r\n  $user = ParseUser::logIn('login', 'password');\r\n  $_SESSION['parseUser'] = $user;\r\n} catch (ParseException $ex) {\r\n\r\n}\r\n\r\n```\r\n\r\nWhen loading the page:\r\n```\r\nif (isset($_SESSION['parseUser'])) {\r\n  $user = $_SESSION['parseUser'];\r\n} else {\r\n  // logged out... \r\n}\r\n```\r\n"}}