|
-
Feb 11th, 2004, 02:16 AM
#1
Thread Starter
Frenzied Member
forms authentication problem
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
-
Feb 11th, 2004, 02:21 AM
#2
Thread Starter
Frenzied Member
I solved it myself But I have no understanding WHY it worked.. but I replaced Server.Transfer with Response.Redirect... Perhaps someone can explain why this works?
kind regards
Henrik
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|