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:
Dim strRole As String = Session("Role") Session.Abandon() FormsAuthentication.SignOut() If strRole = "1" Then Server.Transfer("PageAdmin.aspx") Else Server.Transfer("PageUser.aspx") 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




Reply With Quote