Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Cookies question

    I use forms authentication for my app.
    After I log in successfully each request by the browser contains 2 cookies.
    One for the SessionID and one for forms authentication which contains my
    ticket.

    Can someone please explain where these cookies are stored? I think it is in
    memory in the browser but am not sure.

    Also, some users have stated that they can do the following:
    1. Start a browser, hit the site and log in.
    2. Start a 2nd browser.
    3. Hit the site.
    4. BYPASS the log in page and go directly to the Home page.

    They claim they can also close all browser sessions, start a new one and
    still Bypass the log in page.

    How is this possible?
    Why would the 2nd browser session have the cookies noted above?

    I assume once the authenctication ticket expires in 30 minutes of inactivity
    that neither scenario would be possible. They would have to re-log in first.

    Thanks for any info on this.
    --
    Joe Fallon




    Joe Fallon Guest

  2. Similar Questions and Discussions

    1. php cookies
      Is it possible to set php cookies to delete after a period of user inactivity & if so how?
    2. cookies under php 4.06
      okay, i know this is stupid, and i'm gonna kick myself when someone points out the obvious... i've just put a site online, and found the server's...
    3. SSL, P3P & Cookies.
      Please oh please oh please can someone with some P3P knowledge help me out? I'm aware that this isn't strictly an ASP or IIS issue but the SSL...
    4. No cookies
      Hello, My XP Pro machine does not keep cookies. I've checked two things: A) The history is set to remember 20 days. B) The advanced tab in...
    5. cookies and php
      Hi Is it possible to add information (username + password) into a cookie so that i can get to that information when it is required, eg somebody...
  3. #2

    Default Re: Cookies question

    Hello Joe,

    cookie storage depends - if it is a temporary cookie it is only store in
    browser memory and delete when you shut down the process - persistent cookies
    are stored in the user profile.

    So when do you deal with persistent and when with temporary...

    a cookie that has an expiration time in the future is persisten until that
    point of time.

    In FormsAuthentication - when you use RedirectFromLoginPage - the last parameter
    is a boolean - if true the cookie is persistent (some silly timespan like
    50 years in the future), if false you will end up with a temp cookie.

    When you use persistent cookies, the behaviour with the 2nd browser window
    is like you described it

    Always use temp cookies - you don't want digital ids of your webapp stored
    on a clients machine, do you?

    ---------------------------------------
    Dominick Baier - DevelopMentor
    [url]http://www.leastprivilege.com[/url]
    > I use forms authentication for my app.
    > After I log in successfully each request by the browser contains 2
    > cookies.
    > One for the SessionID and one for forms authentication which contains
    > my
    > ticket.
    > Can someone please explain where these cookies are stored? I think it
    > is in memory in the browser but am not sure.
    >
    > Also, some users have stated that they can do the following:
    > 1. Start a browser, hit the site and log in.
    > 2. Start a 2nd browser.
    > 3. Hit the site.
    > 4. BYPASS the log in page and go directly to the Home page.
    > They claim they can also close all browser sessions, start a new one
    > and still Bypass the log in page.
    >
    > How is this possible?
    > Why would the 2nd browser session have the cookies noted above?
    > I assume once the authenctication ticket expires in 30 minutes of
    > inactivity that neither scenario would be possible. They would have to
    > re-log in first.
    >
    > Thanks for any info on this.
    >


    Dominick Baier [DevelopMentor] Guest

  4. #3

    Default Re: Cookies question

    Dominick,
    Thanks for the response.

    I use temp cookies because I use code like this:
    Web.Security.FormsAuthentication.RedirectFromLogin Page(UID, False)

    I think it is related to spawning a 2nd browser session from the first by
    using Ctrl-N.
    In this case the 2nd browser instance "inherits" the in memory cookies from
    the first.

    The users were using a link to an Intranet site - maybe this link had the
    same effect by spawning a 2nd instance from the first somehow.

    I guess what I don't understand is how they can close all browser instances
    and then click this link and still bypass the log in page. If the cookie is
    temporary and in memory, isn't it destroyed when browser is closed?
    Or is it really stored on disk somewhere until it expires? (I could not find
    it and a re-boot makes it disappear.)

    Thanks for any more input.

    --
    Joe Fallon



    "Dominick Baier [DevelopMentor]" <dbaier@pleasepleasenospamdevelop.com>
    wrote in message news:169758632471743413041942@news.microsoft.com.. .
    > Hello Joe,
    >
    > cookie storage depends - if it is a temporary cookie it is only store in
    > browser memory and delete when you shut down the process - persistent
    cookies
    > are stored in the user profile.
    >
    > So when do you deal with persistent and when with temporary...
    >
    > a cookie that has an expiration time in the future is persisten until that
    > point of time.
    >
    > In FormsAuthentication - when you use RedirectFromLoginPage - the last
    parameter
    > is a boolean - if true the cookie is persistent (some silly timespan like
    > 50 years in the future), if false you will end up with a temp cookie.
    >
    > When you use persistent cookies, the behaviour with the 2nd browser window
    > is like you described it
    >
    > Always use temp cookies - you don't want digital ids of your webapp stored
    > on a clients machine, do you?
    >
    > ---------------------------------------
    > Dominick Baier - DevelopMentor
    > [url]http://www.leastprivilege.com[/url]
    >
    > > I use forms authentication for my app.
    > > After I log in successfully each request by the browser contains 2
    > > cookies.
    > > One for the SessionID and one for forms authentication which contains
    > > my
    > > ticket.
    > > Can someone please explain where these cookies are stored? I think it
    > > is in memory in the browser but am not sure.
    > >
    > > Also, some users have stated that they can do the following:
    > > 1. Start a browser, hit the site and log in.
    > > 2. Start a 2nd browser.
    > > 3. Hit the site.
    > > 4. BYPASS the log in page and go directly to the Home page.
    > > They claim they can also close all browser sessions, start a new one
    > > and still Bypass the log in page.
    > >
    > > How is this possible?
    > > Why would the 2nd browser session have the cookies noted above?
    > > I assume once the authenctication ticket expires in 30 minutes of
    > > inactivity that neither scenario would be possible. They would have to
    > > re-log in first.
    > >
    > > Thanks for any info on this.
    > >
    >
    >
    >

    Joe Fallon Guest

  5. #4

    Default Re: Cookies question

    Hello Joe,

    if you can close down all browser windows and with a new one bypass the login
    then you _have_ to have some peristence going on. this is the only explanation
    - maybe somehting with you session cookie??

    check your code and inspect the http communication by using a tool like fiddler
    ([url]www.fiddlertool.com[/url]).

    HTH

    ---------------------------------------
    Dominick Baier - DevelopMentor
    [url]http://www.leastprivilege.com[/url]
    > Dominick,
    > Thanks for the response.
    > I use temp cookies because I use code like this:
    > Web.Security.FormsAuthentication.RedirectFromLogin Page(UID, False)
    > I think it is related to spawning a 2nd browser session from the first
    > by
    > using Ctrl-N.
    > In this case the 2nd browser instance "inherits" the in memory cookies
    > from
    > the first.
    > The users were using a link to an Intranet site - maybe this link had
    > the same effect by spawning a 2nd instance from the first somehow.
    >
    > I guess what I don't understand is how they can close all browser
    > instances
    > and then click this link and still bypass the log in page. If the
    > cookie is
    > temporary and in memory, isn't it destroyed when browser is closed?
    > Or is it really stored on disk somewhere until it expires? (I could
    > not find
    > it and a re-boot makes it disappear.)
    > Thanks for any more input.
    >
    > "Dominick Baier [DevelopMentor]"
    > <dbaier@pleasepleasenospamdevelop.com> wrote in message
    > news:169758632471743413041942@news.microsoft.com.. .
    >
    >> Hello Joe,
    >>
    >> cookie storage depends - if it is a temporary cookie it is only store
    >> in browser memory and delete when you shut down the process -
    >> persistent
    >>
    > cookies
    >
    >> are stored in the user profile.
    >>
    >> So when do you deal with persistent and when with temporary...
    >>
    >> a cookie that has an expiration time in the future is persisten until
    >> that point of time.
    >>
    >> In FormsAuthentication - when you use RedirectFromLoginPage - the
    >> last
    >>
    > parameter
    >
    >> is a boolean - if true the cookie is persistent (some silly timespan
    >> like 50 years in the future), if false you will end up with a temp
    >> cookie.
    >>
    >> When you use persistent cookies, the behaviour with the 2nd browser
    >> window is like you described it
    >>
    >> Always use temp cookies - you don't want digital ids of your webapp
    >> stored on a clients machine, do you?
    >>
    >> ---------------------------------------
    >> Dominick Baier - DevelopMentor
    >> [url]http://www.leastprivilege.com[/url]
    >>> I use forms authentication for my app.
    >>> After I log in successfully each request by the browser contains 2
    >>> cookies.
    >>> One for the SessionID and one for forms authentication which
    >>> contains
    >>> my
    >>> ticket.
    >>> Can someone please explain where these cookies are stored? I think
    >>> it
    >>> is in memory in the browser but am not sure.
    >>> Also, some users have stated that they can do the following:
    >>> 1. Start a browser, hit the site and log in.
    >>> 2. Start a 2nd browser.
    >>> 3. Hit the site.
    >>> 4. BYPASS the log in page and go directly to the Home page.
    >>> They claim they can also close all browser sessions, start a new one
    >>> and still Bypass the log in page.
    >>> How is this possible?
    >>> Why would the 2nd browser session have the cookies noted above?
    >>> I assume once the authenctication ticket expires in 30 minutes of
    >>> inactivity that neither scenario would be possible. They would have
    >>> to
    >>> re-log in first.
    >>> Thanks for any info on this.
    >>>


    Dominick Baier [DevelopMentor] Guest

  6. #5

    Default Re: Cookies question

    Speaking of tools for debugging HTTP, also check out IEHttpHeaders. It
    doesn't do as much as Fiddler, but it works over SSL (which Fiddler doesn't
    the last time I checked) and does show you cookies info (since they are
    headers). This is one of my favorite tools these days.

    Joe K.

    "Dominick Baier [DevelopMentor]" <dbaier@pleasepleasenospamdevelop.com>
    wrote in message news:174336632472641746102975@news.microsoft.com.. .
    > Hello Joe,
    >
    > if you can close down all browser windows and with a new one bypass the
    > login then you _have_ to have some peristence going on. this is the only
    > explanation - maybe somehting with you session cookie??
    >
    > check your code and inspect the http communication by using a tool like
    > fiddler ([url]www.fiddlertool.com[/url]).
    >
    > HTH
    >
    > ---------------------------------------
    > Dominick Baier - DevelopMentor
    > [url]http://www.leastprivilege.com[/url]
    >
    >> Dominick,
    >> Thanks for the response.
    >> I use temp cookies because I use code like this:
    >> Web.Security.FormsAuthentication.RedirectFromLogin Page(UID, False)
    >> I think it is related to spawning a 2nd browser session from the first
    >> by
    >> using Ctrl-N.
    >> In this case the 2nd browser instance "inherits" the in memory cookies
    >> from
    >> the first.
    >> The users were using a link to an Intranet site - maybe this link had
    >> the same effect by spawning a 2nd instance from the first somehow.
    >>
    >> I guess what I don't understand is how they can close all browser
    >> instances
    >> and then click this link and still bypass the log in page. If the
    >> cookie is
    >> temporary and in memory, isn't it destroyed when browser is closed?
    >> Or is it really stored on disk somewhere until it expires? (I could
    >> not find
    >> it and a re-boot makes it disappear.)
    >> Thanks for any more input.
    >>
    >> "Dominick Baier [DevelopMentor]"
    >> <dbaier@pleasepleasenospamdevelop.com> wrote in message
    >> news:169758632471743413041942@news.microsoft.com.. .
    >>
    >>> Hello Joe,
    >>>
    >>> cookie storage depends - if it is a temporary cookie it is only store
    >>> in browser memory and delete when you shut down the process -
    >>> persistent
    >>>
    >> cookies
    >>
    >>> are stored in the user profile.
    >>>
    >>> So when do you deal with persistent and when with temporary...
    >>>
    >>> a cookie that has an expiration time in the future is persisten until
    >>> that point of time.
    >>>
    >>> In FormsAuthentication - when you use RedirectFromLoginPage - the
    >>> last
    >>>
    >> parameter
    >>
    >>> is a boolean - if true the cookie is persistent (some silly timespan
    >>> like 50 years in the future), if false you will end up with a temp
    >>> cookie.
    >>>
    >>> When you use persistent cookies, the behaviour with the 2nd browser
    >>> window is like you described it
    >>>
    >>> Always use temp cookies - you don't want digital ids of your webapp
    >>> stored on a clients machine, do you?
    >>>
    >>> ---------------------------------------
    >>> Dominick Baier - DevelopMentor
    >>> [url]http://www.leastprivilege.com[/url]
    >>>> I use forms authentication for my app.
    >>>> After I log in successfully each request by the browser contains 2
    >>>> cookies.
    >>>> One for the SessionID and one for forms authentication which
    >>>> contains
    >>>> my
    >>>> ticket.
    >>>> Can someone please explain where these cookies are stored? I think
    >>>> it
    >>>> is in memory in the browser but am not sure.
    >>>> Also, some users have stated that they can do the following:
    >>>> 1. Start a browser, hit the site and log in.
    >>>> 2. Start a 2nd browser.
    >>>> 3. Hit the site.
    >>>> 4. BYPASS the log in page and go directly to the Home page.
    >>>> They claim they can also close all browser sessions, start a new one
    >>>> and still Bypass the log in page.
    >>>> How is this possible?
    >>>> Why would the 2nd browser session have the cookies noted above?
    >>>> I assume once the authenctication ticket expires in 30 minutes of
    >>>> inactivity that neither scenario would be possible. They would have
    >>>> to
    >>>> re-log in first.
    >>>> Thanks for any info on this.
    >>>>
    >
    >
    >

    Joe Kaplan \(MVP - ADSI\) Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139