Automatic log out in Asp.Net Core

Asked

Viewed 42 times

0

I’m using Identity in an ASP.NET CORE project, but I’m having problems uploading the project into production.

When making a POST it sends my information normally, but when changing page and sending another POST occurs "logout" of the system. Logged in again the POST works, but if you change page and try to make a second POST it leaves again.

ASP NET CORE comes with "Forms" with pre-set Antiforgerytoken, so all POST methods are already decorated with the attribute of [Validateantiforgerytoken].

I have tried several ways to increase the expiration date of Identity or antiforgery cookies, I have succeeded in the change, but have not stopped logging out.

OBS: in development environment does not occur logout at any time.

  • Problem solved? Where is your Controller and Actions code?

  • I was able to contain the problem for now, still give a "logoff" at some point if the internet is slow. But the problem was that on my server it was necessary to build an application on IIS for each subdomain and I wasn’t doing it, causing the main domain application to run the code. He had rented a new lodging and was not used to cPanel. Today I publish the ASP.NET sites with dependency on the framework and not self-sufficient too! You have the same problem?

No answers

Browser other questions tagged

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