{"action":"created","issue":{"url":"https://api.github.com/repos/jhedstrom/drupalextension/issues/131","labels_url":"https://api.github.com/repos/jhedstrom/drupalextension/issues/131/labels{/name}","comments_url":"https://api.github.com/repos/jhedstrom/drupalextension/issues/131/comments","events_url":"https://api.github.com/repos/jhedstrom/drupalextension/issues/131/events","html_url":"https://github.com/jhedstrom/drupalextension/pull/131","id":56047425,"number":131,"title":"Use better technique to determine whether user is logged in","user":{"login":"axe312ger","id":1737026,"avatar_url":"https://avatars.githubusercontent.com/u/1737026?v=3","gravatar_id":"","url":"https://api.github.com/users/axe312ger","html_url":"https://github.com/axe312ger","followers_url":"https://api.github.com/users/axe312ger/followers","following_url":"https://api.github.com/users/axe312ger/following{/other_user}","gists_url":"https://api.github.com/users/axe312ger/gists{/gist_id}","starred_url":"https://api.github.com/users/axe312ger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axe312ger/subscriptions","organizations_url":"https://api.github.com/users/axe312ger/orgs","repos_url":"https://api.github.com/users/axe312ger/repos","events_url":"https://api.github.com/users/axe312ger/events{/privacy}","received_events_url":"https://api.github.com/users/axe312ger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-01-30T15:34:56Z","updated_at":"2015-05-20T07:33:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jhedstrom/drupalextension/pulls/131","html_url":"https://github.com/jhedstrom/drupalextension/pull/131","diff_url":"https://github.com/jhedstrom/drupalextension/pull/131.diff","patch_url":"https://github.com/jhedstrom/drupalextension/pull/131.patch"},"body":"Not all websites have the logout link on the front page, in my case, Chrome with Selenium was simply to fast,  admin-menu showed up after the check for the link happened.\r\n\r\nSince there is no real 100% reliable method in D7, I've implemented two more methods to determine if a user is logged in. (D8 has the user information in the global Drupal Javascript object)\r\n\r\nFirst test: Check for a \"logged-in\" class on the body element, most themes support this. (Mothership for example doesn't)\r\nSecond test: Visit \"/user/login\", if there is no login form, the user should be logged in.\r\n\r\nI also had the Idea to simple check \"/user/login\" for a 403 status code, but this is not supported by Selenium because it is out of scope. (https://code.google.com/p/selenium/issues/detail?id=141)"},"comment":{"url":"https://api.github.com/repos/jhedstrom/drupalextension/issues/comments/103794252","html_url":"https://github.com/jhedstrom/drupalextension/pull/131#issuecomment-103794252","issue_url":"https://api.github.com/repos/jhedstrom/drupalextension/issues/131","id":103794252,"user":{"login":"axe312ger","id":1737026,"avatar_url":"https://avatars.githubusercontent.com/u/1737026?v=3","gravatar_id":"","url":"https://api.github.com/users/axe312ger","html_url":"https://github.com/axe312ger","followers_url":"https://api.github.com/users/axe312ger/followers","following_url":"https://api.github.com/users/axe312ger/following{/other_user}","gists_url":"https://api.github.com/users/axe312ger/gists{/gist_id}","starred_url":"https://api.github.com/users/axe312ger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axe312ger/subscriptions","organizations_url":"https://api.github.com/users/axe312ger/orgs","repos_url":"https://api.github.com/users/axe312ger/repos","events_url":"https://api.github.com/users/axe312ger/events{/privacy}","received_events_url":"https://api.github.com/users/axe312ger/received_events","type":"User","site_admin":false},"created_at":"2015-05-20T07:33:40Z","updated_at":"2015-05-20T07:33:40Z","body":"Just checked it out, it looks like the session cookie is only set if you are logged in. For some reason, I had in mind that this cookie is even set when you are logged out. I try to update this pull request asap :)"}}