Hi Marc,
Regarding on the Login control(LoggedIn event) and membership service
behavior you mentioned, I think it is the expected one due to how the
FormsAuthentication issue authenticate ticket and retrieve it back at
sequential requests.
When the user click "login" button of the ASP.NET application login
page(secured through forms authentication), the following occurs:
1. Login control look for the membership provider and use it to verify the
username/password credentials
2. If validate success, it will generate authentication ticket and store it
into response's cookie collection
3. use response.Redirect to forward the user to the original requested
page(or the default page which can be configured in Formsauthentication
setting)
For your case, you use "Server.Transfer" to forward the user. Then, because
server.transfer does not return to client-side, so the
authentication-ticket(cookie) hasn't been able to store in client cookie,
and request also doesn't go through the Forms AuthenticationMOdule which
will populate the Context.User.Identity(from authentication ticket).
That's why you can not get the Context.User.Identity if you use
"Server.Transfer" after LoggedIn.
One way to overcome this problem is use Response.Redirect instead of
Server.Transfer. This make the a client-side redirection which can ensure
the authentication ticket(cookie) be persisted and updated, and the new
redirected request will got through the FormsAutheitcation Module that
help correctlyl populate the Context.User.Identity property. How do you
think?
Hope this helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 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 or complex
project analysis and dump analysis issues. 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/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.