I have seen different behavior of asp .net if I update content in master page,and I browse application some time it redirect to log in page and some not.
Why it happening explain if any one having clear idea.
What kind of authentication/authorization do you have?
We are authenticating against database.
most likely you did not define a machine key in your web.config. if not defined a new key is generated on application start. as the authentication cookie is encrypted with this key, aft a recycle the cookie can not be decoded, so its as if it was not sent.
asp.net does a auto recycle after x number of code changes. just define a machine key in the web.config, and authentication will survive a recycle. change session to sql session, and session also will survive a recycle.
as you said
just define a machine key in the web.config, and authentication will survive a recycle
Without defining machine key in the web.config in web config the app is recycling.
It seems that your app recycling results into missing authorization header. You can try using fiddler to see if the response header when redirecting to log in page.
And If you are using IIS as webserver, you can check the recycle event log.
For more information, please refer to the similar discussion:
This is happening in development env not in published.So the website is running on development server not on IIS.