{"action":"created","issue":{"url":"https://api.github.com/repos/t4t5/sweetalert/issues/441","labels_url":"https://api.github.com/repos/t4t5/sweetalert/issues/441/labels{/name}","comments_url":"https://api.github.com/repos/t4t5/sweetalert/issues/441/comments","events_url":"https://api.github.com/repos/t4t5/sweetalert/issues/441/events","html_url":"https://github.com/t4t5/sweetalert/issues/441","id":105117744,"number":441,"title":"php redirect after swal","user":{"login":"lucafrassineti","id":10064740,"avatar_url":"https://avatars.githubusercontent.com/u/10064740?v=3","gravatar_id":"","url":"https://api.github.com/users/lucafrassineti","html_url":"https://github.com/lucafrassineti","followers_url":"https://api.github.com/users/lucafrassineti/followers","following_url":"https://api.github.com/users/lucafrassineti/following{/other_user}","gists_url":"https://api.github.com/users/lucafrassineti/gists{/gist_id}","starred_url":"https://api.github.com/users/lucafrassineti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucafrassineti/subscriptions","organizations_url":"https://api.github.com/users/lucafrassineti/orgs","repos_url":"https://api.github.com/users/lucafrassineti/repos","events_url":"https://api.github.com/users/lucafrassineti/events{/privacy}","received_events_url":"https://api.github.com/users/lucafrassineti/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-06T21:20:07Z","updated_at":"2015-09-09T10:35:19Z","closed_at":"2015-09-09T10:35:19Z","body":"I'm trying to set sweetalert before automatic redirect on login if the user is not logged, but it appear just a second and redirect start immediately, how can i set to wait user click?\r\n\r\nmy actual code:\r\n```\r\nif ($_SESSION[logged] != 'yes') { \r\necho '\r\n<script type=\"text/javascript\" src=\"http://code.jquery.com/jquery-latest.js\"></script>\r\n<link rel=\"stylesheet\" href=\"stylesheets/sweetalert.css\">\r\n<script src=\"javascripts/custom/sweetalert.min.js\"></script>\r\n<script>\r\n$( document ).ready(function() {\r\n\tswal(\"Oops...\", \"Not logged!\", \"error\");\r\n\tdocument.location.href=\"/login.html\"\r\n});\r\n</script>';\r\nexit; \r\n```"},"comment":{"url":"https://api.github.com/repos/t4t5/sweetalert/issues/comments/138868263","html_url":"https://github.com/t4t5/sweetalert/issues/441#issuecomment-138868263","issue_url":"https://api.github.com/repos/t4t5/sweetalert/issues/441","id":138868263,"user":{"login":"lucafrassineti","id":10064740,"avatar_url":"https://avatars.githubusercontent.com/u/10064740?v=3","gravatar_id":"","url":"https://api.github.com/users/lucafrassineti","html_url":"https://github.com/lucafrassineti","followers_url":"https://api.github.com/users/lucafrassineti/followers","following_url":"https://api.github.com/users/lucafrassineti/following{/other_user}","gists_url":"https://api.github.com/users/lucafrassineti/gists{/gist_id}","starred_url":"https://api.github.com/users/lucafrassineti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucafrassineti/subscriptions","organizations_url":"https://api.github.com/users/lucafrassineti/orgs","repos_url":"https://api.github.com/users/lucafrassineti/repos","events_url":"https://api.github.com/users/lucafrassineti/events{/privacy}","received_events_url":"https://api.github.com/users/lucafrassineti/received_events","type":"User","site_admin":false},"created_at":"2015-09-09T10:35:19Z","updated_at":"2015-09-09T10:35:19Z","body":"I solved with this thank you!\r\n\r\n```\r\nif ($_SESSION[logged] != 'yes') { \r\necho '\r\n<script type=\"text/javascript\" src=\"http://code.jquery.com/jquery-latest.js\"></script>\r\n<link rel=\"stylesheet\" href=\"stylesheets/sweetalert2.css\">\r\n<script src=\"javascripts/custom/sweetalert2.min.js\"></script>\r\n<script>\r\n$( document ).ready(function() {\r\n\tswal({\r\n         title: 'Oops..',\r\n       text: 'Not logged!',\r\n       type: 'error',\r\n}, function(isConfirm) {\r\n     document.location.href=\"/login.html\"\r\n});\r\n});\r\n</script>';\r\nexit; \r\n};\r\n```"}}