{"action":"created","issue":{"url":"https://api.github.com/repos/HangfireIO/Hangfire/issues/978","repository_url":"https://api.github.com/repos/HangfireIO/Hangfire","labels_url":"https://api.github.com/repos/HangfireIO/Hangfire/issues/978/labels{/name}","comments_url":"https://api.github.com/repos/HangfireIO/Hangfire/issues/978/comments","events_url":"https://api.github.com/repos/HangfireIO/Hangfire/issues/978/events","html_url":"https://github.com/HangfireIO/Hangfire/issues/978","id":251879117,"number":978,"title":"Hangfire Dashboard: Post requests have null Session.","user":{"login":"ab3nash","id":10881232,"avatar_url":"https://avatars2.githubusercontent.com/u/10881232?v=4","gravatar_id":"","url":"https://api.github.com/users/ab3nash","html_url":"https://github.com/ab3nash","followers_url":"https://api.github.com/users/ab3nash/followers","following_url":"https://api.github.com/users/ab3nash/following{/other_user}","gists_url":"https://api.github.com/users/ab3nash/gists{/gist_id}","starred_url":"https://api.github.com/users/ab3nash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ab3nash/subscriptions","organizations_url":"https://api.github.com/users/ab3nash/orgs","repos_url":"https://api.github.com/users/ab3nash/repos","events_url":"https://api.github.com/users/ab3nash/events{/privacy}","received_events_url":"https://api.github.com/users/ab3nash/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-08-22T08:37:06Z","updated_at":"2017-09-25T06:33:17Z","closed_at":null,"author_association":"NONE","body":"I am using session variables for dashboard authentication. It works fine for logging in, the session variable is set. I can access the dashboard, the list of enqueued/scheduled/failed jobs, they return the session cookie to the server, but when I click on any job in them, the HttpContext.Current.Session is null.\r\n\r\nFor example: For the url:  ~/job/details/225 \r\n\r\nAuthorize returns false on requests generated when trying to view job details of hangfire jobs in any list.\r\n```C#\r\n    public class CustomDashboardAuthFilter : IDashboardAuthorizationFilter\r\n    {\r\n        public bool Authorize(DashboardContext context)\r\n        {\r\n            if (System.Web.HttpContext.Current.Session == null)\r\n            {\r\n                // Session is always null for requests generated by clicking on a job\r\n                 return false; \r\n            }\r\n            //some other case:\r\n            return true;\r\n        }\r\n    }\r\n```\r\nHangfire.Core (1.6.14)\r\nHangfire.MySqlStorage (1.0.5)"},"comment":{"url":"https://api.github.com/repos/HangfireIO/Hangfire/issues/comments/331789032","html_url":"https://github.com/HangfireIO/Hangfire/issues/978#issuecomment-331789032","issue_url":"https://api.github.com/repos/HangfireIO/Hangfire/issues/978","id":331789032,"user":{"login":"ab3nash","id":10881232,"avatar_url":"https://avatars2.githubusercontent.com/u/10881232?v=4","gravatar_id":"","url":"https://api.github.com/users/ab3nash","html_url":"https://github.com/ab3nash","followers_url":"https://api.github.com/users/ab3nash/followers","following_url":"https://api.github.com/users/ab3nash/following{/other_user}","gists_url":"https://api.github.com/users/ab3nash/gists{/gist_id}","starred_url":"https://api.github.com/users/ab3nash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ab3nash/subscriptions","organizations_url":"https://api.github.com/users/ab3nash/orgs","repos_url":"https://api.github.com/users/ab3nash/repos","events_url":"https://api.github.com/users/ab3nash/events{/privacy}","received_events_url":"https://api.github.com/users/ab3nash/received_events","type":"User","site_admin":false},"created_at":"2017-09-25T06:33:17Z","updated_at":"2017-09-25T06:33:17Z","author_association":"NONE","body":"Yes. Configuration:\r\n```\r\n<system.web>        \r\n    <httpRuntime targetFramework=\"4.5.1\" />        \r\n    <compilation debug=\"true\" targetFramework=\"4.5.1\" />\r\n    <httpModules>\r\n          <add name=\"ForceSessionModule\" type=\"ForceSessionModule\"/>\r\n    </httpModules>\r\n</system.web>\r\n```\r\nI have used the same implementation of IHttpModule from the above comment.\r\n"}}
{"actor":{"display_login":"ab3nash"}}