I have a small strange question with forms authentication...

I have three pages (for starters)

login.aspx and PageAdmin.aspx and PageUser.aspx

The loginurl is set to login.aspx

When I login I am transferred to either of the two pages depending of wether the user is admin or user. I have a menu as a usercontrol which renders regarding of the role...(admin have more options)

Now, I also have a logout button in the menu... it does this:

VB Code:
  1. Dim strRole As String = Session("Role")
  2.         Session.Abandon()
  3.         FormsAuthentication.SignOut()
  4.         If strRole = "1" Then
  5.             Server.Transfer("PageAdmin.aspx")
  6.         Else
  7.             Server.Transfer("PageUser.aspx")
  8.         End If

Pretty simple stuff... I kill the auth-cookie, clear the session and transfer the user to either the user or admin page. I tried to transfer to the Login.aspx directly, and then something wierd is happening...

on the url it says .../PageAdmin.aspx but the page is the login page... when I click login I am transferred to "default.aspx" which I have NO reference to in my app.

If I try the code I wrote above I am transferred to the page directly without going to the Login.aspx (which it should do, since the auth-cookie is deleted)


can anyone help me with this, I am dead in the water.....

kind regards
Henrik