Hi guys,
I'm trying to share session variables between my .net website and a classic asp website. I've succeeded in doing so but I have a small problem.
basically when a user logs into the asp website I write all their session variables to an xml file. Then when a user clicks a link thank redirects to the .Net webpage I have a function in the global.asax Session_Start that does a webrequest to the xml file and reads all the asp session variables into .Net session variables.
Works fine to that point. I then try to create an authentication cookie in the globabl.asax like this
This works as well, however I've read that the authentication cookie only gets processed on a page redirect. I hide/display a toolbar based on whether the user is logged in.Code:If (Not Membership.GetUser( MyApplicationSession.UserName) Is Nothing) Then FormsAuthentication.SetAuthCookie(MyApplicationSession.UserName, False) End If
Since the cookie doesn't get proccessed the first time the menu is hidden. If I refresh the page it then detects the logged in user and displays the menu.Code:If Roles.IsUserInRole("Administrator") Then Me.rptMenu.Visible = True Else Me.rptMenu.Visible = False End If
How can I handle the redirect from the global.asax. please help




Reply With Quote