Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. logout not abandoning session

logout not abandoning session

Scheduled Pinned Locked Moved ASP.NET
securityhelpcsharpasp-netmysql
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    janetb99
    wrote on last edited by
    #1

    I've got a custom asp.net 2 login authentication creating a generic principal object and working great except that I can't get the logout to truly abandon/clear. For most of the site, I'm using one master page, but for the secure area, I'm using another master page. The secure master page uses menus, with the logout being a menu item redirect to another page (login.aspx?id=logout) with request parameters to fire. When I click logout, it does indeed take me back to the login page. But, if I manually type in the page where I've just been, it lets me through without a login. I've tried researching the problem and implementing suggestions to others, but nothing has worked. Any help GREATLY appreciated. webConfig: global.asax Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs) If HttpContext.Current.User IsNot Nothing Then If HttpContext.Current.User.Identity.IsAuthenticated Then If TypeOf HttpContext.Current.User.Identity Is FormsIdentity Then ' Get Forms Identity From Current User Dim id As FormsIdentity = DirectCast(HttpContext.Current.User.Identity, FormsIdentity) ' Get Forms Ticket From Identity object Dim ticket As FormsAuthenticationTicket = id.Ticket ' userdata string was retrieved from stored user-data Dim userData As String = ticket.UserData Dim roles As String() = userData.Split(","c) ' Create a new Generic Principal Instance and assign to Current User System.Web.HttpContext.Current.User = New System.Security.Principal.GenericPrincipal(id, roles) End If End If Else System.Web.HttpContext.Current.User = Nothing End If End Sub login.aspx Function myAuth(ByVal mySql As String) As Boolean 'Response.Write(mySql) FormsAuthentication.Initialize() ' Initialize FormsAuthentication ' Create connection and command objects , contactRole Dim strConn As String = Con

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups