strange cookie problem

Discussion in 'ASP General' started by Jaakko T Oksa, Dec 11, 2003.

  1. suppose i have a script which sets a cookie in this manner:

    Response.Cookies("session_id") = '12345'
    Response.Cookies("session_id").Expires = <future date here>
    Response.Cookies("session_id").Path = "/"

    and another script which clears it like this

    Response.Cookies("session_id") = ""

    The scripts are located in a directory "mysite" under iis root directory
    and accessed through http://localhost/mysite/something.asp

    When these are called repeatedly, everything works as expected
    (script number 1 sets the cookie and number 2 clears it)

    However, when I create a virtual directory called "mysite" and point it
    to the same place, script number one is no longer able to set the cookie
    after script number two has been called, even though they are still accessed
    exactly the same way (http://localhost/mysite/something.asp)

    But when I modify the code in script number one by removing the last two lines
    ("expires" and "path") it works as expected again.

    Anyone know why this would happen?

    Jaakko Oksa
    jaakko at vilmamedia dot fi
     
    Jaakko T Oksa, Dec 11, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. alex

    Cookie problem. Very strange!!!!

    alex, Feb 8, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    323
    Eric Lawrence [MSFT]
    Feb 8, 2004
  2. jensen bredal

    Strange Cookie problem!

    jensen bredal, May 11, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    363
    jensen bredal
    May 11, 2005
  3. Johnny Jörgensen

    Strange Cookie Problem

    Johnny Jörgensen, Mar 13, 2009, in forum: ASP .Net
    Replies:
    2
    Views:
    344
    Alexey Smirnov
    Mar 13, 2009
  4. Tony Archer
    Replies:
    10
    Views:
    210
    Tony Archer
    Dec 1, 2003
  5. Tony Archer
    Replies:
    0
    Views:
    124
    Tony Archer
    Dec 1, 2003
Loading...

Share This Page