Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Login / Logout

Reply
Thread Tools

Login / Logout

 
 
MichaelR
Guest
Posts: n/a
 
      01-05-2005
I have an asp.net application using forms authentication.

1. It has a simple login page (login.aspx) that uses
FormsAuthentication.RedirectFromLoginPage(. . . ).
2. My application has a logout function that Redirects to signout.aspx.
Signout.aspx invokes FormsAuthentication.Signout() when it loads.
3. Signout.aspx also has a login button that redirects to my application
page (index.aspx). Because the user is no longer authenticated, asp.net
properly invokes the login.aspx page.
4. If I login again using the same user id, no problem - I go right to
index.aspx.
5. However, if I login using a different user id, I get redirected to
signout.aspx. I've tested the value of FormsAuthentication.GetRedirectUrl(.
.. . ) and it is clearly setting the RedirectUrl to signout.aspx.

Is there some way to prevent this from happening? Is it possible to set the
RedirectUrl using my .Net code? Better yet, is there a recommended way to
implement a login / logout function that will allow different user ids?



 
Reply With Quote
 
 
 
 
Karl Seguin
Guest
Posts: n/a
 
      01-05-2005
Instead of relying on RedirectFromLoginPage you can do the same via
SetAuthCookie and a response.redirect. You can get the redirect URL via
GetRedirectURL

http://msdn.microsoft.com/library/de...ookietopic.asp

and

http://msdn.microsoft.com/library/de...cturltopic.asp

HTH
Karl



--
MY ASP.Net tutorials
http://www.openmymind.net/


"MichaelR" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have an asp.net application using forms authentication.
>
> 1. It has a simple login page (login.aspx) that uses
> FormsAuthentication.RedirectFromLoginPage(. . . ).
> 2. My application has a logout function that Redirects to signout.aspx.
> Signout.aspx invokes FormsAuthentication.Signout() when it loads.
> 3. Signout.aspx also has a login button that redirects to my application
> page (index.aspx). Because the user is no longer authenticated, asp.net
> properly invokes the login.aspx page.
> 4. If I login again using the same user id, no problem - I go right to
> index.aspx.
> 5. However, if I login using a different user id, I get redirected to
> signout.aspx. I've tested the value of

FormsAuthentication.GetRedirectUrl(.
> . . ) and it is clearly setting the RedirectUrl to signout.aspx.
>
> Is there some way to prevent this from happening? Is it possible to set

the
> RedirectUrl using my .Net code? Better yet, is there a recommended way to
> implement a login / logout function that will allow different user ids?
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Forms Login/Logout Brian Henry ASP .Net 3 06-04-2008 11:49 AM
Logout status doesn't really logout? =?Utf-8?B?dmE=?= ASP .Net 1 03-26-2006 10:56 PM
RE: Logout status doesn't really logout? =?Utf-8?B?RFdT?= ASP .Net 0 03-26-2006 10:51 PM
RE: Logout status doesn't really logout? =?Utf-8?B?dmE=?= ASP .Net 0 03-26-2006 10:50 PM
Login of different user after Logout Michael Groeger ASP .Net 0 08-19-2005 11:32 AM



Advertisments