Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Login of different user after Logout

Reply
Thread Tools

Login of different user after Logout

 
 
Michael Groeger
Guest
Posts: n/a
 
      08-19-2005
Hi,

I have implemented a simple page for FormsAuthentication and when user data
is accepted I redirect the user using
FormsAuthentication.RedirectFromLoginPage().

private void btnLogin_Click(object sender, System.EventArgs e)
{
// [...]
FormsAuthentication.RedirectFromLoginPage(username , false);
}

The application the user enters has a logout button, which calls
Session.Abandon() and FormsAuthentication.SignOut() when clicked and then
redirects the user to the main page of the application, which causes the
login page to show up again.

private Page_Load(object sender, System.EventArgs e)
{
Session.Abandon();
FormsAuthentication.SignOut();
Response.Redirect("main.aspx");
}

So far so good, when I now enter the application with the same user again,
everything works fine, but when I try to login another user, I always get
back to the login page. I also tried to do login by hand, but with the same
effect:

private void btnLogin_Click(object sender, System.EventArgs e)
{
// [...]
FormsAuthentication.SetAuthCookie(username, false);
string url = FormsAuthentication.GetRedirectUrl(username, false);
Response.Redirect(url);
}

So what am I doing wrong here?

Regards,
Michael


 
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
Single login/logout for two different websites: How? Author ASP .Net 1 01-15-2009 08:00 PM
Re: Single login/logout for two different websites: How? Gregory A. Beamer ASP .Net 0 01-15-2009 07:35 PM
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



Advertisments