Results 1 to 3 of 3

Thread: Security issue with cookies

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Indiana
    Posts
    612

    Security issue with cookies

    I have a log off button on my web form which sets the login id, priveledge, etc. to nothing. Like this.

    VB Code:
    1. Response.Cookies("LoginName").Value = Nothing
    2. Response.Cookies("LoginName").Expires.AddMilliseconds(1)
    3. Response.Cookies("Priveledge").Value = Nothing
    4. Response.Cookies("Priveledge").Expires.AddMilliseconds(1)
    5. Response.Redirect("Login.aspx")

    In my page load event on the form, I have it running this code first.

    VB Code:
    1. Dim strPriveledge as String
    2. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    3.  
    4. If (Request.Cookies("Priveledge") Is Nothing) Then
    5.         Response.Redirect("Login.aspx")
    6.    Else
    7.        strPriveledge = Request.Cookies("Priveledge").Value
    8.    End If
    9.    If strPriveledge = "" Or strPriveledge = Nothing Then
    10.        Response.Redirect("Login.aspx")
    11.    Else
    12.        strPriveledge = Request.Cookies("Priveledge").Value
    13. End If
    14.  
    15. End Sub

    If the user has no valid cookies, I do not want this page to load, I want them to be re-directed to the Login screen.

    All this works great in the debug stage. The problem is after I pulish it and I use it from somewhere else.

    After I log off and then click the favorite button, the page actually displays the page with the data in it allthough I have destroyed the cookies.

    Anyone have any ideas on what could be causing this?

    I have even verified that the cookie is wiped out.

    Thanks
    Last edited by indydavid32; Nov 3rd, 2003 at 03:40 PM.
    David Wilhelm

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Look at this link:
    http://www.vbforums.com/showthread.p...hreadid=245643

    This shows authentication in asp.net apps and how to incorporate it.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Indiana
    Posts
    612
    Now that I've done some more testing, I think my web app is loading the latest web page that the user loaded.

    When the user hits the logout button, could I remove the temporary file that is saved to it's hard drive if there are any there for this particular page?

    If so, how?

    Thanks
    David Wilhelm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width