1 COOKIE avaialble on 2 DOMAINs

Results 1 to 2 of 2

Thread: 1 COOKIE avaialble on 2 DOMAINs

  1. #1
    Join Date
    Dec 1969

    Default 1 COOKIE avaialble on 2 DOMAINs

    I operate 2 internal web sites that need to share cookie information. Not using a domain is unfortunatley not an option. <BR><BR>---Example---<BR>Response.Cookies("MyCookie").Domain="www.a.com " <BR>Response.Cookies("MyCookie")("string") = "Hello"<BR><BR>Request.Cookies("MyCookie")("string ") would not be accessable from www.b.com - and this is the problem. <BR>---<BR><BR>---Bad Theory---<BR><BR>Could something like this be done?<BR>Response.Cookies("MyCookie").Domain="www. a.com, www.b.com" <BR>Response.Cookies("MyCookie")("string") = "Hello"<BR>---<BR><BR>Please advise ....<BR><BR>Thanks!

  2. #2
    Join Date
    Dec 1969

    Default RE: 1 COOKIE avaialble on 2 DOMAINs

    What&#039;s your name, microsoft?<BR>Trying to implement your own passport? <BR><BR>:-)<BR><BR>You cant&#039; do that, cookies are domain specific.<BR><BR>What you have to do is bounce the user back and forth between your two sites, set the cookie on each one and bounce back, you pass the required information by wacking the information you need to store as a cookie on the query string (if you log onto hotmail you&#039;ll see no end of this going on.)<BR><BR>So,<BR>site 1,<BR>page1<BR>set cookie "string" = "hello"<BR>response.redirect("otherdomain/setcookie.asp?action=setcookie&cookiename=string&v alue=hello") &#039;you would replace string and hello with variables (probably)<BR><BR>site 2<BR>setcookie.asp<BR>set cookie(request.querystring("cookiename")) = request.querystring("value")<BR>response.redirect( "firstdomain/page2.asp")<BR><BR>This is just psudeocode so change as required.<BR><BR>Do the same for people who hit site 2 first.<BR><BR>Also -- be VERY careful with your bounces or you could just get people into a horrible loop.<BR><BR><BR><BR>

Posting Permissions

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