.net - Strange logging off on ASP.NET 3.5 website -


Please feel frustrated in trying to find this problem, and I do not know

I It is seen that, when a user logs in the morning, then it is immediately logged off, then when he logs on again, everything is fine and he can work on the site.

Every time a user clicks on a link, the page takes a lot of time to load, but it does not actually load, and the user is thrown onto the login page .

In addition to this, after the website has an exception, the user is put on the login page. It seems that the exception clears the session in some way.

Do you know of any one of the situations where this can happen?

The code used in every page in my application is as follows:

  If (not User.Identity.IsAuthenticated) then Response.Redirect ("../ Login 2 ("Session ID") is DBNull.Value) or (session ("LocationId") is nothing)) Response.Redirect (if the "session is timeout then return to login screen") ../translation2.aspx ") If the  

code in Web.config:

   & Lt; Authentication mode = "form" & gt; & Lt; Form timeout = "600" /> & Lt; System.web & gt; & Lt; Authority & gt; & Lt; Allow users = "*" /> & Lt; / Authorization & gt; & Lt; /system.web>  

Why are you using that code in every page?

.NET authorization and authentication usually takes care of all those things if you have set it correctly.


Comments