RE: Reconnect to a session and authenticate.
- From: stcheng@xxxxxxxxxxxxxxxxxxxx ("Steven Cheng")
- Date: Thu, 06 Mar 2008 04:15:14 GMT
Hi Jerry,
As for restorting FormsAuthentication state, I think it's much easier than
session since the FormsAuthentication.SetAuthCookie method I mentioned
earlier can help regenerate the authenticate cookie. Therefore, I think
what you need to do is just store the username in a custom cookie item. And
later when you need to regenerate the authenticate state, just read the
username from that cookie item and call the
FormsAuthentication.SetAuthCookie, how do you think?
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: =?Utf-8?B?SmVycnkgQw==?= <jerryed@xxxxxxxxxxxxx><TTJd7#bfIHA.1500@xxxxxxxxxxxxxxxxxxxxxx>
References: <6A0F7399-8AD4-47C7-ABB5-BA02BE97BFD3@xxxxxxxxxxxxx>
Subject: RE: Reconnect to a session and authenticate.
Date: Wed, 5 Mar 2008 07:43:03 -0800
the
Steven,
The solution I posted did not work in all cases. I used the custom session
Id manager in the link.
Now the question is how do I restore the authentication without sending
user name in the Qstring. I do store the forms auth cookie in the querya
string. How do I use it the authenticate.
Thank you
--
Jerry
""Steven Cheng"" wrote:
Hi Jerry,
From your description, I understand you want to programmatically restore
codecertain session connection or forms authentication connection in your
username):(by supplying the sessionID or authentication info) , correct?
Based on my understanding, for forms authentication, it is quite easy to
regenerate the authentication state, you can simply call the following
method to make the current user be authenticated again(supply the
info(such
FormsAuthentication.SetAuthCookie(username, true);
However, for session state, it is always done(validate client cookie) by
the built-in session state module. If you put the session state
addas ID) in querystring, runtime will not know it. You can try manually
ASP.NETthe cookie (that contain the sessionID you previously stored) into
http://msdn2.microsoft.com/en-us/library/system.web.sessionstate.sessionidmaresponse.
If this not work, you may have a look at creating a custom
SessionIDManager, that can help you add your own code logic to read and
generate sessionID:
#Overcoming IE Bug with a Custom SessionIDManager
http://blogs.microsoft.co.il/blogs/dorony/
#SessionIDManager Class
http://www.exforsys.com/tutorials/asp.net-2.0/asp.net-2.0-customizing-the-senager(VS.80).aspx
#ASP.NET 2.0 Training : Customizing the Session State Mechanism
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notifssion-state-mechanism.html
Hope this helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
issuesications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent
followwhere an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each
theup response may take approximately 2 business days as the support
professional working with you may need further investigation to reach
situationsmost efficient resolution. The offering is not appropriate for
bestthat require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are
contactinghandled working with a dedicated Microsoft Support Engineer by
rights.Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
creator
--------------------
From: =?Utf-8?B?SmVycnkgQw==?= <jerryed@xxxxxxxxxxxxx>
Subject: Reconnect to a session and authenticate.
Date: Mon, 3 Mar 2008 14:43:01 -0800
pages
I have an asp.net application using forms authentication. On one of my
I use a control that does not return the cookies in firefox. (the
of
the control will remain nameless) I can include the session cookieauthentication in
"ASP.NET_SessionId" and the cookie ââ?¬Å?CDââ??placed by the forms
the querystring. The Question is how do I reconnect to the session and
reauthenticate when this page posts back so my session vars are there.
--
Jerry
.
- Follow-Ups:
- RE: Reconnect to a session and authenticate.
- From: Jerry C
- RE: Reconnect to a session and authenticate.
- References:
- RE: Reconnect to a session and authenticate.
- From: "Steven Cheng"
- RE: Reconnect to a session and authenticate.
- From: Jerry C
- RE: Reconnect to a session and authenticate.
- Prev by Date: Re: How to use SSL for login page only
- Next by Date: RE: IIS having problems creating temp directories
- Previous by thread: RE: Reconnect to a session and authenticate.
- Next by thread: RE: Reconnect to a session and authenticate.
- Index(es):
Relevant Pages
|