how to logout safely?

Discussion in 'C#' started by bclassic, Jul 7, 2008.

  1. #1
    what are the important factors for a safe logout?

    how to prevent leak out info when back page ?
     
    bclassic, Jul 7, 2008 IP
  2. itcn

    itcn Well-Known Member

    Messages:
    795
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    118
    #2
    What kind of logout system are you using? Do you set a cookie, and then clear it when someone clicks logout?
     
    itcn, Jul 9, 2008 IP
  3. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #3
    first describe the login process and then we'll help you with logout
     
    ludwig, Jul 12, 2008 IP
  4. salman4raza

    salman4raza Peon

    Messages:
    373
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    paste the code. or even tell us about that.


    btw, logging out is like when user clicks on logout

    click on logout > redirected to an other page > redirect to another page after clearing all the cookies or setting cookies variables.


    what you say?
     
    salman4raza, Jul 21, 2008 IP
  5. artivity

    artivity Guest

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    First of all I would hope you are using sessions for your login system as opposed to cookies. If you are then all you need to do is simply clear the session variable(s).

    example:

    <%
    Session.Contents.Remove("user_id")
    Session.Contents.Remove("username")
    Response.Redirect("logged_out.asp")
    %>
     
    artivity, Jul 23, 2008 IP
  6. Social.Network

    Social.Network Member

    Messages:
    517
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    35
    #6
    Invoking the Session.Contents.Remove method will delete the items from the session, but the session is still active until it times out or is explicitly destroyed using the Session.Abandon method. Just a thought.
     
    Social.Network, Jul 24, 2008 IP