HangfireIO / HangfireIO/Hangfire

Hangfire Dashboard: Post requests have null Session.

Open
#978 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
10.1k
Forks
1.8k
Avg merge
1h 19m
Merged PRs (30d)
1

Description

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.

For example: For the url: ~/job/details/225

Authorize returns false on requests generated when trying to view job details of hangfire jobs in any list.
```C#
public class CustomDashboardAuthFilter : IDashboardAuthorizationFilter
{
public bool Authorize(DashboardContext context)
{
if (System.Web.HttpContext.Current.Session == null)
{
// Session is always null for requests generated by clicking on a job
return false;
}
//some other case:
return true;
}
}
```
Hangfire.Core (1.6.14)
Hangfire.MySqlStorage (1.0.5)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.