#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2007
    Posts
    114
    Rep Power
    0

    IIS storing different cookies


    My site stores users login info in cookies and I noticed that they values stored can be different for http://mysite vs. http://www.mysite. More specifically, I login with two test accounts then logout (storing the username in a cookie) and then I output the username to the screen. The cookie value is different for http://mysite vs. http://www.mysite even though I followed the same login/logout process on each.


    Is there something I can do in IIS to prevent this?
  2. #2
  3. No Profile Picture
    Stumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,409
    Rep Power
    4538
    I don't know of any IIS settings affecting cookie domains directly, I've always seen your problem corrected by the server php/asp code, not the server. Many applications have settings that let you decide how cookie domains are used.
    ======
    Doug G
    ======
    It is a truism of American politics that no man who can win an election deserves to. --Trevanian, from the novel Shibumi
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2009
    Posts
    166
    Rep Power
    5
    Hello,

    This is because non www and www versions of the site are two different domains. To resolve this you should use only one domain name for the site and by example to redirect the non www version to www version. This could be done with IIS 301 redirect or URL rewriting. Also, this will be good for your google page rank too, because now you have two domains with the same content.

    Regards
    http://www.windowshostingasp.net/ - Free ASP.NET Web hosting resources and information.

IMN logo majestic logo threadwatch logo seochat tools logo