Ajax request in C# update authentication

Asked

Viewed 537 times

2

as I do for each Ajax request, update the Forms Authentication cookie.

I want to update on Forms Authentication in my controller, because it is a calendar screen that uses Fullcalendar.

I’m having trouble on a page, which only makes ajax requests and after a while if the user goes to another screen, asks login and password.

  • For ajax requests, you are doing it yourself or are using the <asp:UpdatePanel>?

  • As far as I know, making Ajax requests does not depress the user.

  • I edited question to make it clearer. It’s a normal ajax request without user Updatepanel.

1 answer

1

Two years ago I made AJAX requests without using tools or API’s support.

The target resource for AJAX requests was "Generic Handlers" (with ASHX extension).

After a long time just making this kind of request, the Session gave timeout, and my user ended up undone.

I corrected, simply adding System.Web.SessionState.IRequiresSessionState to class inheritance.

Class declaration before (gave timeout and relaxed):

public class DisponibilidadeHandler : IHttpHandler

Class declaration after (started to work OK, no timeout and without undoing):

public class DisponibilidadeHandler : IHttpHandler, System.Web.SessionState.IRequiresSessionState

Browser other questions tagged

You are not signed in. Login or sign up in order to post.