2

I have an ashx handler and I would like to check that the user trying to access it through a JSON call actually has a forms Authenticated session. Is this possible?

Exitos
  • 29,230
  • 38
  • 123
  • 178

2 Answers2

1

You can check in your handler code if the user is authenticated. The auth cookie will be passed along with your ajax request.

public void ProcessRequest(HttpContext context)
 {

    if (!context.Request.IsAuthenticated)
    {
      // 401 response
    }

    // authenticated 

 }
Dallas
  • 2,217
  • 1
  • 13
  • 13
1

Turns out uploadify doesnt pass the session properly I posting this question so everyone can see!

The answer is here:

Uploadify (Session and authentication) with ASP.NET MVC

Community
  • 1
  • 1
Exitos
  • 29,230
  • 38
  • 123
  • 178