Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 Questions About Response.Cookies().Domain 1

Status
Not open for further replies.

XgrinderX

Programmer
Mar 27, 2001
225
0
0
US
Hey all!

Assuming I have 3 domains as follows:

app1.domain.com on server 1
app2.domain.com on server 2
images.domain.com on server 3

Question 1: If I set a cookie attribute Response.Cookies("cookiename").Domain = "domain.com" should the cookie be accessible across all 3 of those domains?

Question 2: If the answer to Q1 is yes, will it still work if app1 and app2 are on https protocol but images is not?

Thanks in advance.

-Greg
 
Hey thanks! I had actually already discovered I could do question 1 by simply setting up a test and running it. However I have hit a snag and hope maybe someone can help.

We have and images.domain.com and they are both on live production servers open to the public. Then we also have a dev.domain.com setup within our firewall and is only accessible while on the network.

I can pass cookies from to images.domain.com BUT I cannot seem to pass cookies from dev.domain.com to images.domain.com. Does this have to do with the way the domains are setup?

-Greg
 
could be how the domains are setup, from my past experience i dont depends on subdomains to be reliable especially in cross communication even if hosted on the same server.

use some form of refid in the query string, post it, server.transfer whatever, then write the cookie after the handshake, then you knowingly have cookies existing for any all sub domain handling, plus you know you've managed to handshake between the domains properly.. safe than sorry.

speaking of safe than sorry, when you handshake do a session too, in case cookies are off.

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
" I always think outside the 'box', because I'm never inside the 'loop' " - DreX 2005
 
forgot to mention :

reason for the extra CYA is you'd have to replicate code all over the place, end users do some whacky stuff.

access your domain by:

domain.com, re-directed from images.domain.com because of a bookmark, whatever.

expect them pesky endusers to curveball you good :)

[thumbsup2]DreX
aKa - Robert
if all else fails, light it on fire and do the happy dance!
" I always think outside the 'box', because I'm never inside the 'loop' " - DreX 2005
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top