Hi Oriane,
From your description, in your ASP.NET web application which use Forms
authentcation, sometimes the user will encounter unexpected logout
behavior, correct?
As for this problem, I think it is possible that the forms authentication
ticket(generated after user has login/passed the login form) has been lost
or invalid. Are you using the LoginControl to login user(or manually write
code to login, such as FormsAuthentication.RedirectFrom.....)?
Here are some possible causes I can get, you may have a look over them to
see whether the issue is caused by any of them:
** Since ASP.NET forums authentication rely on cookie to store the
authentication ticket, we have to ensure the client-side browser has fully
support on cookie so that the problem is not caused by client-side.
** As for forms authentication, it has a timeout setting, you can check
whether this setting has been manually changed or is configured as a proper
value(or if you leave it as default):
#Forms Authentication timeout default in ASP.NET 2.0
http://weblogs.asp.net/scottgu/archive/2005/11/08/430011.aspx
** The machinekey problem. And this is what I think the most likely cause.
ASP.NET application need to encrypt and sign many data(such as ViewState,
WebResource url string, and FormsAuthentidcation ticket). However, the Key
used to encrypt/sign data is by default auto-generated by Appdomain, and
the key will change whenever the appdomain restart. Therefore, if your
ASP.NET application has restarted due to some reason(such as unhandled
exception), the forms authentication ticket(and other data rely on the
machine key ) will become invalid for the new application
instance(appdomain). One means to resolve this problem is manually specify
a machinekey for your ASP.NET web application. Here is a msdn article which
introduce the machinekey usage in ASP.NET 2.0:
#How To: Configure MachineKey in ASP.NET 2.0
http://msdn.microsoft.com/en-us/library/ms998288.aspx
If there is anything unclear on this, please feel free to post here.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.
Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------