Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > pass cookie from one domain to another on the same server

Reply
Thread Tools

pass cookie from one domain to another on the same server

 
 
c676228
Guest
Posts: n/a
 
      11-21-2007
Hi all,
Is there an easier way to handle that? I used Javascript to handle this when
our two domains are hosted on two different servers(on different networks)
and our search engine marketing people don't like the javascript links since
they think the links are not favorable to a search robot.

Now our company is thinking about hosting these two domians on the same
server,
So I am wodering if there is any easy way to do that. Would you provide me
some clues?
Thank you so much.
--
Betty
 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      11-21-2007
=?Utf-8?B?YzY3NjIyOA==?= wrote on 21 nov 2007 in
microsoft.public.inetserver.asp.general:

> Is there an easier way to handle that?


Please do not use the subjectline as part of your Q.

> I used Javascript to handle
> this when our two domains are hosted on two different servers(on
> different networks)


Cookies exist on the client per domain, and cannot be passed to another
domain.

The cookie content string can be palced on two domains seperately.

> and our search engine marketing people don't like
> the javascript links since they think the links are not favorable to a
> search robot.


Sorry? Does this have anything to do with your Q?

> Now our company is thinking about hosting these two domians on the
> same server,
> So I am wodering if there is any easy way to do that. Would you
> provide me some clues?


What you can do with two domains on two servers, you can do with two
domains on one server. Cookies do not live on a server.

Any reason why this sould not be the case?


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      11-22-2007
Hi Betty,

As for the "copy cookie from one domain to another", I'd like to confirm
the exact things you want to achieve:

** cookie is stored on client machine and whenever browser visit a site, it
will send the cookies (belong to that site based on the server domain name)
to server.

** when you change cookies, that means you change the cookies at
server-side and it is until the response reach client will the cookies data
actually be updated in client store

** For cookies, your server-side code(ASP or ASP.NET) can only add/remove
cookie within its own domain(or the same main domain and different sub
domain).

Therefore, normally, manipulate cookies under same top domain (and
different sub domains) are directly supported. However, if you want to
manipulate cookies for different top domain in single application, you will
need particular machnism setup in your context(for all those
applications/sites that want to share cookies). Here is an article
discussing something about this:

#Sharing Cookies Across Domains
http://support.softartisans.com/kbview_666.aspx

Hope this helps some.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



This posting is provided "AS IS" with no warranties, and confers no rights.





--------------------
>From: =?Utf-8?B?YzY3NjIyOA==?= <(E-Mail Removed)>
>Subject: pass cookie from one domain to another on the same server
>Date: Wed, 21 Nov 2007 13:47:00 -0800


>
>Hi all,
>Is there an easier way to handle that? I used Javascript to handle this

when
>our two domains are hosted on two different servers(on different networks)
>and our search engine marketing people don't like the javascript links

since
>they think the links are not favorable to a search robot.
>
>Now our company is thinking about hosting these two domians on the same
>server,
>So I am wodering if there is any easy way to do that. Would you provide me
>some clues?
>Thank you so much.
>--
>Betty
>


 
Reply With Quote
 
Brynn
Guest
Posts: n/a
 
      11-24-2007
On Nov 21, 3:47 pm, c676228 <(E-Mail Removed)> wrote:
> Hi all,
> Is there an easier way to handle that? I used Javascript to handle this when
> our two domains are hosted on two different servers(on different networks)
> and our search engine marketing people don't like the javascript links since
> they think the links are not favorable to a search robot.
>
> Now our company is thinking about hosting these two domians on the same
> server,
> So I am wodering if there is any easy way to do that. Would you provide me
> some clues?
> Thank you so much.
> --
> Betty


I would also be interested in knowing what you are storing in those
cookies.

I have changed almost everything over to server side data storage,
including shopping carts, etc... all on my servers.

The only thing the cookie does for me is keeps them unique for me. If
I wanted them to be on 2 domains ... during a login process I would
simply have a data pass to a cookie on the other domain. I like to use
invisible iframes in my pages for passes like that.

I had one project that I wanted to keep a session alive between 2
sites even ... I think I used a 1px by 1px iframe in the footer of
both websites that was a blank design asp webpage.

Anyway, let us know more about what you are doing between them,

Brynn Curry
 
Reply With Quote
 
c676228
Guest
Posts: n/a
 
      11-26-2007
Hi all,
Thanks for your reply. Here is my case.
Our company initially(about more than 5 years ago) has a web site(domain A)
which is hosted by a company on a lynix system. Later on our company decided
to have some dynamic pages(sales processes) which were written in asp on our
site too. So the company decided to host those pages on a different
domain(domain B) with another hosting company. So when one of our customers
gets on to our page 1 on domain A from a specific agents site, (we always
have a producer code, stored as a cookie, assigned to our specific agent),
and then if this customer's navigation on our domain A lead to a sale on our
domain B, say page 2, then this cookie values need to be carried onto domain
B, so this value could be written into our database and the sales credit will
go to our specific agents.

When we pass our cookie value from domain A to domain B, I used the
javascript. that's why I am asking th question. I am trying to think about
another way which will be better for search engine.
Thank you.
--
Betty


"Brynn" wrote:

> On Nov 21, 3:47 pm, c676228 <(E-Mail Removed)> wrote:
> > Hi all,
> > Is there an easier way to handle that? I used Javascript to handle this when
> > our two domains are hosted on two different servers(on different networks)
> > and our search engine marketing people don't like the javascript links since
> > they think the links are not favorable to a search robot.
> >
> > Now our company is thinking about hosting these two domians on the same
> > server,
> > So I am wodering if there is any easy way to do that. Would you provide me
> > some clues?
> > Thank you so much.
> > --
> > Betty

>
> I would also be interested in knowing what you are storing in those
> cookies.
>
> I have changed almost everything over to server side data storage,
> including shopping carts, etc... all on my servers.
>
> The only thing the cookie does for me is keeps them unique for me. If
> I wanted them to be on 2 domains ... during a login process I would
> simply have a data pass to a cookie on the other domain. I like to use
> invisible iframes in my pages for passes like that.
>
> I had one project that I wanted to keep a session alive between 2
> sites even ... I think I used a 1px by 1px iframe in the footer of
> both websites that was a blank design asp webpage.
>
> Anyway, let us know more about what you are doing between them,
>
> Brynn Curry
>

 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      11-27-2007
Hi Betty,

Yes, you may need to look for some other approaches. For share cookie, I
think the last link in my previous reply (below) should be a doable
appraoch:

http://support.softartisans.com/kbview_666.aspx

Hi BeSharp,

As for the D LINQ selection scenario you mentioned, I think it sounds like
what you want to do is a SQL "LIKE" comparison. For {"...",
"..."}.contains, "contains" actually means that the input parameter exactly
match any of the i tem in collection, that is not substring mapping. For
substring mapping, you should use SQL "Like" style selection. Here is a web
thread discussing on using "LIKE" query in LINQ:

#using LIKE in DLinq
http://forums.microsoft.com/MSDN/Sho...08989&SiteID=1

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.





--------------------
>From: =?Utf-8?B?YzY3NjIyOA==?= <(E-Mail Removed)>
>Subject: Re: pass cookie from one domain to another on the same server
>Date: Sun, 25 Nov 2007 20:21:01 -0800
>
>Hi all,
>Thanks for your reply. Here is my case.
>Our company initially(about more than 5 years ago) has a web site(domain

A)
>which is hosted by a company on a lynix system. Later on our company

decided
>to have some dynamic pages(sales processes) which were written in asp on

our
>site too. So the company decided to host those pages on a different
>domain(domain B) with another hosting company. So when one of our

customers
>gets on to our page 1 on domain A from a specific agents site, (we always
>have a producer code, stored as a cookie, assigned to our specific agent),
>and then if this customer's navigation on our domain A lead to a sale on

our
>domain B, say page 2, then this cookie values need to be carried onto

domain
>B, so this value could be written into our database and the sales credit

will
>go to our specific agents.
>
>When we pass our cookie value from domain A to domain B, I used the
>javascript. that's why I am asking th question. I am trying to think about
>another way which will be better for search engine.
>Thank you.
>--
>Betty
>
>
>"Brynn" wrote:
>
>> On Nov 21, 3:47 pm, c676228 <(E-Mail Removed)> wrote:
>> > Hi all,
>> > Is there an easier way to handle that? I used Javascript to handle

this when
>> > our two domains are hosted on two different servers(on different

networks)
>> > and our search engine marketing people don't like the javascript links

since
>> > they think the links are not favorable to a search robot.
>> >
>> > Now our company is thinking about hosting these two domians on the same
>> > server,
>> > So I am wodering if there is any easy way to do that. Would you

provide me
>> > some clues?
>> > Thank you so much.
>> > --
>> > Betty

>>
>> I would also be interested in knowing what you are storing in those
>> cookies.
>>
>> I have changed almost everything over to server side data storage,
>> including shopping carts, etc... all on my servers.
>>
>> The only thing the cookie does for me is keeps them unique for me. If
>> I wanted them to be on 2 domains ... during a login process I would
>> simply have a data pass to a cookie on the other domain. I like to use
>> invisible iframes in my pages for passes like that.
>>
>> I had one project that I wanted to keep a session alive between 2
>> sites even ... I think I used a 1px by 1px iframe in the footer of
>> both websites that was a blank design asp webpage.
>>
>> Anyway, let us know more about what you are doing between them,
>>
>> Brynn Curry
>>

>


 
Reply With Quote
 
c676228
Guest
Posts: n/a
 
      11-29-2007

Hi Steven,
You are right. The link you provided is dorable for my case. In order to
replace all javascript coded links from domain A, I need to replace all the
html pages on domain A to .asp page, so I can pass cookie value from query
string from domain A to domain B. This will be beneficail to site traffic
since a crawler will index those pages.

Thank you so much for your great help
--
Betty


"Steven Cheng[MSFT]" wrote:

> Hi Betty,
>
> Yes, you may need to look for some other approaches. For share cookie, I
> think the last link in my previous reply (below) should be a doable
> appraoch:
>
> http://support.softartisans.com/kbview_666.aspx
>
> Hi BeSharp,
>
> As for the D LINQ selection scenario you mentioned, I think it sounds like
> what you want to do is a SQL "LIKE" comparison. For {"...",
> "..."}.contains, "contains" actually means that the input parameter exactly
> match any of the i tem in collection, that is not substring mapping. For
> substring mapping, you should use SQL "Like" style selection. Here is a web
> thread discussing on using "LIKE" query in LINQ:
>
> #using LIKE in DLinq
> http://forums.microsoft.com/MSDN/Sho...08989&SiteID=1
>
> Hope this helps.
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>
>
>
> --------------------
> >From: =?Utf-8?B?YzY3NjIyOA==?= <(E-Mail Removed)>
> >Subject: Re: pass cookie from one domain to another on the same server
> >Date: Sun, 25 Nov 2007 20:21:01 -0800
> >
> >Hi all,
> >Thanks for your reply. Here is my case.
> >Our company initially(about more than 5 years ago) has a web site(domain

> A)
> >which is hosted by a company on a lynix system. Later on our company

> decided
> >to have some dynamic pages(sales processes) which were written in asp on

> our
> >site too. So the company decided to host those pages on a different
> >domain(domain B) with another hosting company. So when one of our

> customers
> >gets on to our page 1 on domain A from a specific agents site, (we always
> >have a producer code, stored as a cookie, assigned to our specific agent),
> >and then if this customer's navigation on our domain A lead to a sale on

> our
> >domain B, say page 2, then this cookie values need to be carried onto

> domain
> >B, so this value could be written into our database and the sales credit

> will
> >go to our specific agents.
> >
> >When we pass our cookie value from domain A to domain B, I used the
> >javascript. that's why I am asking th question. I am trying to think about
> >another way which will be better for search engine.
> >Thank you.
> >--
> >Betty
> >
> >
> >"Brynn" wrote:
> >
> >> On Nov 21, 3:47 pm, c676228 <(E-Mail Removed)> wrote:
> >> > Hi all,
> >> > Is there an easier way to handle that? I used Javascript to handle

> this when
> >> > our two domains are hosted on two different servers(on different

> networks)
> >> > and our search engine marketing people don't like the javascript links

> since
> >> > they think the links are not favorable to a search robot.
> >> >
> >> > Now our company is thinking about hosting these two domians on the same
> >> > server,
> >> > So I am wodering if there is any easy way to do that. Would you

> provide me
> >> > some clues?
> >> > Thank you so much.
> >> > --
> >> > Betty
> >>
> >> I would also be interested in knowing what you are storing in those
> >> cookies.
> >>
> >> I have changed almost everything over to server side data storage,
> >> including shopping carts, etc... all on my servers.
> >>
> >> The only thing the cookie does for me is keeps them unique for me. If
> >> I wanted them to be on 2 domains ... during a login process I would
> >> simply have a data pass to a cookie on the other domain. I like to use
> >> invisible iframes in my pages for passes like that.
> >>
> >> I had one project that I wanted to keep a session alive between 2
> >> sites even ... I think I used a 1px by 1px iframe in the footer of
> >> both websites that was a blank design asp webpage.
> >>
> >> Anyway, let us know more about what you are doing between them,
> >>
> >> Brynn Curry
> >>

> >

>
>

 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      11-30-2007
You're welcome

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
>X-WBNR-Posting-Host: 12.104.97.211
>From: =?Utf-8?B?YzY3NjIyOA==?= <(E-Mail Removed)>
>Subject: Re: pass cookie from one domain to another on the same server
>Date: Thu, 29 Nov 2007 10:15:03 -0800


>
>
>Hi Steven,
>You are right. The link you provided is dorable for my case. In order to
>replace all javascript coded links from domain A, I need to replace all

the
>html pages on domain A to .asp page, so I can pass cookie value from query
>string from domain A to domain B. This will be beneficail to site traffic
>since a crawler will index those pages.
>
>Thank you so much for your great help
>--
>Betty
>
>
>"Steven Cheng[MSFT]" wrote:
>
>> Hi Betty,
>>
>> Yes, you may need to look for some other approaches. For share cookie,

I
>> think the last link in my previous reply (below) should be a doable
>> appraoch:
>>
>> http://support.softartisans.com/kbview_666.aspx
>>
>> Hi BeSharp,
>>
>> As for the D LINQ selection scenario you mentioned, I think it sounds

like
>> what you want to do is a SQL "LIKE" comparison. For {"...",
>> "..."}.contains, "contains" actually means that the input parameter

exactly
>> match any of the i tem in collection, that is not substring mapping.

For
>> substring mapping, you should use SQL "Like" style selection. Here is a

web
>> thread discussing on using "LIKE" query in LINQ:
>>
>> #using LIKE in DLinq
>> http://forums.microsoft.com/MSDN/Sho...08989&SiteID=1
>>
>> Hope this helps.
>>
>> Sincerely,
>>
>> Steven Cheng
>>
>> Microsoft MSDN Online Support Lead
>>
>>
>> This posting is provided "AS IS" with no warranties, and confers no

rights.
>>
>>
>>
>>
>>
>> --------------------
>> >From: =?Utf-8?B?YzY3NjIyOA==?= <(E-Mail Removed)>
>> >Subject: Re: pass cookie from one domain to another on the same server
>> >Date: Sun, 25 Nov 2007 20:21:01 -0800
>> >
>> >Hi all,
>> >Thanks for your reply. Here is my case.
>> >Our company initially(about more than 5 years ago) has a web

site(domain
>> A)
>> >which is hosted by a company on a lynix system. Later on our company

>> decided
>> >to have some dynamic pages(sales processes) which were written in asp

on
>> our
>> >site too. So the company decided to host those pages on a different
>> >domain(domain B) with another hosting company. So when one of our

>> customers
>> >gets on to our page 1 on domain A from a specific agents site, (we

always
>> >have a producer code, stored as a cookie, assigned to our specific

agent),
>> >and then if this customer's navigation on our domain A lead to a sale

on
>> our
>> >domain B, say page 2, then this cookie values need to be carried onto

>> domain
>> >B, so this value could be written into our database and the sales

credit
>> will
>> >go to our specific agents.
>> >
>> >When we pass our cookie value from domain A to domain B, I used the
>> >javascript. that's why I am asking th question. I am trying to think

about
>> >another way which will be better for search engine.
>> >Thank you.
>> >--
>> >Betty
>> >
>> >
>> >"Brynn" wrote:
>> >
>> >> On Nov 21, 3:47 pm, c676228 <(E-Mail Removed)> wrote:
>> >> > Hi all,
>> >> > Is there an easier way to handle that? I used Javascript to handle

>> this when
>> >> > our two domains are hosted on two different servers(on different

>> networks)
>> >> > and our search engine marketing people don't like the javascript

links
>> since
>> >> > they think the links are not favorable to a search robot.
>> >> >
>> >> > Now our company is thinking about hosting these two domians on the

same
>> >> > server,
>> >> > So I am wodering if there is any easy way to do that. Would you

>> provide me
>> >> > some clues?
>> >> > Thank you so much.
>> >> > --
>> >> > Betty
>> >>
>> >> I would also be interested in knowing what you are storing in those
>> >> cookies.
>> >>
>> >> I have changed almost everything over to server side data storage,
>> >> including shopping carts, etc... all on my servers.
>> >>
>> >> The only thing the cookie does for me is keeps them unique for me. If
>> >> I wanted them to be on 2 domains ... during a login process I would
>> >> simply have a data pass to a cookie on the other domain. I like to use
>> >> invisible iframes in my pages for passes like that.
>> >>
>> >> I had one project that I wanted to keep a session alive between 2
>> >> sites even ... I think I used a 1px by 1px iframe in the footer of
>> >> both websites that was a blank design asp webpage.
>> >>
>> >> Anyway, let us know more about what you are doing between them,
>> >>
>> >> Brynn Curry
>> >>
>> >

>>
>>

>


 
Reply With Quote
 
c676228
Guest
Posts: n/a
 
      01-25-2008
Hi Steven,

I am bit confused about cookie again.
Based on the informaiton you provided. I have the following asp code to pass
a cookie id value from domainA to domainB. But it seems that cookie
behaviors in firefox and IE are different and also the cookie value written
by IE cannot be recognized by firefox and vise vursa.

What this code basically does is check the querystring to see if the number
is there, if yes, set the value to the cookie called id, if not, we check the
cookie id on client's machine for this domainA , if it is there,use this
value as cookie id value, if not, assign a default number 12345 to this
cookie id.

function WriteLinkPgm is for creating a dynamic link to domainB with this
cookie id value attached to a specific link.

When I tested in IE, everything seems to work as what I want. but when I use
firefox to do the testing and when I close the first firefox browser, the
initial cookie value cannot be recognized by the second firefox browser, say
the initial is 22222, the second browser id value will be "12345"
instead(which is a default value.) if this time the web address doesn't have
a specific number attached, but I want 22222. why firefox forgets, but if I
leave the first firefox open, it works. but I did set the expires property,
besides, when you open both IE and firefox two browsers, it seems that the
cookie value set up by one of the browsers cannot be recognized by the other,
I set the domain property and path, how come?

Sincerely
Betty

<%
Dim HttpStr, LiveFlag
LiveFlag=False
If LiveFlag Then
HttpStr="https://"
Else
HttpStr="http://"
End If


pcnumber = Request.ServerVariables("QUERY_STRING")
If NOT isNULL(pcnumber) and Len(pcnumber)>=5 and Len(pcnumber)<=7 Then
Response.Cookies("id") = pcnumber
Else
id = Request.Cookies("id")
If ((IsNull(Trim(id))) OR (Trim(Len(id)) = 0)) Then
Response.Cookies("id") ="12345" 'a defualt cookie value
Else
Response.Cookies("id")=id
End If
End If

Response.Cookies("id").Domain = ".domainA.com"
Response.Cookies("id").Expires = "December 31, 2020"
Response.cookies("id").path="/"

id = Request.Cookies("id")

Function WriteLinkPgm(byVal DomainB, byVal Pgm, byVal DisplayText)

WriteLinkPgm="<A HREF=" & HttpStr & DomainB & Pgm & "?" & id & ">" &
DisplayText & "</A>"

End Function
%>


--
Betty


"Steven Cheng[MSFT]" wrote:

> You're welcome
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> --------------------
> >X-WBNR-Posting-Host: 12.104.97.211
> >From: =?Utf-8?B?YzY3NjIyOA==?= <(E-Mail Removed)>
> >Subject: Re: pass cookie from one domain to another on the same server
> >Date: Thu, 29 Nov 2007 10:15:03 -0800

>
> >
> >
> >Hi Steven,
> >You are right. The link you provided is dorable for my case. In order to
> >replace all javascript coded links from domain A, I need to replace all

> the
> >html pages on domain A to .asp page, so I can pass cookie value from query
> >string from domain A to domain B. This will be beneficail to site traffic
> >since a crawler will index those pages.
> >
> >Thank you so much for your great help
> >--
> >Betty
> >
> >
> >"Steven Cheng[MSFT]" wrote:
> >
> >> Hi Betty,
> >>
> >> Yes, you may need to look for some other approaches. For share cookie,

> I
> >> think the last link in my previous reply (below) should be a doable
> >> appraoch:
> >>
> >> http://support.softartisans.com/kbview_666.aspx
> >>
> >> Hi BeSharp,
> >>
> >> As for the D LINQ selection scenario you mentioned, I think it sounds

> like
> >> what you want to do is a SQL "LIKE" comparison. For {"...",
> >> "..."}.contains, "contains" actually means that the input parameter

> exactly
> >> match any of the i tem in collection, that is not substring mapping.

> For
> >> substring mapping, you should use SQL "Like" style selection. Here is a

> web
> >> thread discussing on using "LIKE" query in LINQ:
> >>
> >> #using LIKE in DLinq
> >> http://forums.microsoft.com/MSDN/Sho...08989&SiteID=1
> >>
> >> Hope this helps.
> >>
> >> Sincerely,
> >>
> >> Steven Cheng
> >>
> >> Microsoft MSDN Online Support Lead
> >>
> >>
> >> This posting is provided "AS IS" with no warranties, and confers no

> rights.
> >>
> >>
> >>
> >>
> >>
> >> --------------------
> >> >From: =?Utf-8?B?YzY3NjIyOA==?= <(E-Mail Removed)>
> >> >Subject: Re: pass cookie from one domain to another on the same server
> >> >Date: Sun, 25 Nov 2007 20:21:01 -0800
> >> >
> >> >Hi all,
> >> >Thanks for your reply. Here is my case.
> >> >Our company initially(about more than 5 years ago) has a web

> site(domain
> >> A)
> >> >which is hosted by a company on a lynix system. Later on our company
> >> decided
> >> >to have some dynamic pages(sales processes) which were written in asp

> on
> >> our
> >> >site too. So the company decided to host those pages on a different
> >> >domain(domain B) with another hosting company. So when one of our
> >> customers
> >> >gets on to our page 1 on domain A from a specific agents site, (we

> always
> >> >have a producer code, stored as a cookie, assigned to our specific

> agent),
> >> >and then if this customer's navigation on our domain A lead to a sale

> on
> >> our
> >> >domain B, say page 2, then this cookie values need to be carried onto
> >> domain
> >> >B, so this value could be written into our database and the sales

> credit
> >> will
> >> >go to our specific agents.
> >> >
> >> >When we pass our cookie value from domain A to domain B, I used the
> >> >javascript. that's why I am asking th question. I am trying to think

> about
> >> >another way which will be better for search engine.
> >> >Thank you.
> >> >--
> >> >Betty
> >> >
> >> >
> >> >"Brynn" wrote:
> >> >
> >> >> On Nov 21, 3:47 pm, c676228 <(E-Mail Removed)> wrote:
> >> >> > Hi all,
> >> >> > Is there an easier way to handle that? I used Javascript to handle
> >> this when
> >> >> > our two domains are hosted on two different servers(on different
> >> networks)
> >> >> > and our search engine marketing people don't like the javascript

> links
> >> since
> >> >> > they think the links are not favorable to a search robot.
> >> >> >
> >> >> > Now our company is thinking about hosting these two domians on the

> same
> >> >> > server,
> >> >> > So I am wodering if there is any easy way to do that. Would you
> >> provide me
> >> >> > some clues?
> >> >> > Thank you so much.
> >> >> > --
> >> >> > Betty
> >> >>
> >> >> I would also be interested in knowing what you are storing in those
> >> >> cookies.
> >> >>
> >> >> I have changed almost everything over to server side data storage,
> >> >> including shopping carts, etc... all on my servers.
> >> >>
> >> >> The only thing the cookie does for me is keeps them unique for me. If
> >> >> I wanted them to be on 2 domains ... during a login process I would
> >> >> simply have a data pass to a cookie on the other domain. I like to use
> >> >> invisible iframes in my pages for passes like that.
> >> >>
> >> >> I had one project that I wanted to keep a session alive between 2
> >> >> sites even ... I think I used a 1px by 1px iframe in the footer of
> >> >> both websites that was a blank design asp webpage.
> >> >>
> >> >> Anyway, let us know more about what you are doing between them,
> >> >>
> >> >> Brynn Curry
> >> >>
> >> >
> >>
> >>

> >

>
>

 
Reply With Quote
 
c676228
Guest
Posts: n/a
 
      01-25-2008
Hi all,

At least I figured out part of it. Firefox gives user more control about the
cookies. So my firefox somehow set up the cookie like "keep it until I close
browser" not " until they expire".
That's why the firefox cannot remember the cookies set up in the former
session. If it sets to until they expire, everything is just like IE.

But I still don't get the part why the cookies set up by IE cannot be
recognized by firefox.
--
Betty


"c676228" wrote:

> Hi Steven,
>
> I am bit confused about cookie again.
> Based on the informaiton you provided. I have the following asp code to pass
> a cookie id value from domainA to domainB. But it seems that cookie
> behaviors in firefox and IE are different and also the cookie value written
> by IE cannot be recognized by firefox and vise vursa.
>
> What this code basically does is check the querystring to see if the number
> is there, if yes, set the value to the cookie called id, if not, we check the
> cookie id on client's machine for this domainA , if it is there,use this
> value as cookie id value, if not, assign a default number 12345 to this
> cookie id.
>
> function WriteLinkPgm is for creating a dynamic link to domainB with this
> cookie id value attached to a specific link.
>
> When I tested in IE, everything seems to work as what I want. but when I use
> firefox to do the testing and when I close the first firefox browser, the
> initial cookie value cannot be recognized by the second firefox browser, say
> the initial is 22222, the second browser id value will be "12345"
> instead(which is a default value.) if this time the web address doesn't have
> a specific number attached, but I want 22222. why firefox forgets, but if I
> leave the first firefox open, it works. but I did set the expires property,
> besides, when you open both IE and firefox two browsers, it seems that the
> cookie value set up by one of the browsers cannot be recognized by the other,
> I set the domain property and path, how come?
>
> Sincerely
> Betty
>
> <%
> Dim HttpStr, LiveFlag
> LiveFlag=False
> If LiveFlag Then
> HttpStr="https://"
> Else
> HttpStr="http://"
> End If
>
>
> pcnumber = Request.ServerVariables("QUERY_STRING")
> If NOT isNULL(pcnumber) and Len(pcnumber)>=5 and Len(pcnumber)<=7 Then
> Response.Cookies("id") = pcnumber
> Else
> id = Request.Cookies("id")
> If ((IsNull(Trim(id))) OR (Trim(Len(id)) = 0)) Then
> Response.Cookies("id") ="12345" 'a defualt cookie value
> Else
> Response.Cookies("id")=id
> End If
> End If
>
> Response.Cookies("id").Domain = ".domainA.com"
> Response.Cookies("id").Expires = "December 31, 2020"
> Response.cookies("id").path="/"
>
> id = Request.Cookies("id")
>
> Function WriteLinkPgm(byVal DomainB, byVal Pgm, byVal DisplayText)
>
> WriteLinkPgm="<A HREF=" & HttpStr & DomainB & Pgm & "?" & id & ">" &
> DisplayText & "</A>"
>
> End Function
> %>
>
>
> --
> Betty
>
>
> "Steven Cheng[MSFT]" wrote:
>
> > You're welcome
> >
> > Sincerely,
> >
> > Steven Cheng
> >
> > Microsoft MSDN Online Support Lead
> >
> >
> > This posting is provided "AS IS" with no warranties, and confers no rights.
> >
> > --------------------
> > >X-WBNR-Posting-Host: 12.104.97.211
> > >From: =?Utf-8?B?YzY3NjIyOA==?= <(E-Mail Removed)>
> > >Subject: Re: pass cookie from one domain to another on the same server
> > >Date: Thu, 29 Nov 2007 10:15:03 -0800

> >
> > >
> > >
> > >Hi Steven,
> > >You are right. The link you provided is dorable for my case. In order to
> > >replace all javascript coded links from domain A, I need to replace all

> > the
> > >html pages on domain A to .asp page, so I can pass cookie value from query
> > >string from domain A to domain B. This will be beneficail to site traffic
> > >since a crawler will index those pages.
> > >
> > >Thank you so much for your great help
> > >--
> > >Betty
> > >
> > >
> > >"Steven Cheng[MSFT]" wrote:
> > >
> > >> Hi Betty,
> > >>
> > >> Yes, you may need to look for some other approaches. For share cookie,

> > I
> > >> think the last link in my previous reply (below) should be a doable
> > >> appraoch:
> > >>
> > >> http://support.softartisans.com/kbview_666.aspx
> > >>
> > >> Hi BeSharp,
> > >>
> > >> As for the D LINQ selection scenario you mentioned, I think it sounds

> > like
> > >> what you want to do is a SQL "LIKE" comparison. For {"...",
> > >> "..."}.contains, "contains" actually means that the input parameter

> > exactly
> > >> match any of the i tem in collection, that is not substring mapping.

> > For
> > >> substring mapping, you should use SQL "Like" style selection. Here is a

> > web
> > >> thread discussing on using "LIKE" query in LINQ:
> > >>
> > >> #using LIKE in DLinq
> > >> http://forums.microsoft.com/MSDN/Sho...08989&SiteID=1
> > >>
> > >> Hope this helps.
> > >>
> > >> Sincerely,
> > >>
> > >> Steven Cheng
> > >>
> > >> Microsoft MSDN Online Support Lead
> > >>
> > >>
> > >> This posting is provided "AS IS" with no warranties, and confers no

> > rights.
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> --------------------
> > >> >From: =?Utf-8?B?YzY3NjIyOA==?= <(E-Mail Removed)>
> > >> >Subject: Re: pass cookie from one domain to another on the same server
> > >> >Date: Sun, 25 Nov 2007 20:21:01 -0800
> > >> >
> > >> >Hi all,
> > >> >Thanks for your reply. Here is my case.
> > >> >Our company initially(about more than 5 years ago) has a web

> > site(domain
> > >> A)
> > >> >which is hosted by a company on a lynix system. Later on our company
> > >> decided
> > >> >to have some dynamic pages(sales processes) which were written in asp

> > on
> > >> our
> > >> >site too. So the company decided to host those pages on a different
> > >> >domain(domain B) with another hosting company. So when one of our
> > >> customers
> > >> >gets on to our page 1 on domain A from a specific agents site, (we

> > always
> > >> >have a producer code, stored as a cookie, assigned to our specific

> > agent),
> > >> >and then if this customer's navigation on our domain A lead to a sale

> > on
> > >> our
> > >> >domain B, say page 2, then this cookie values need to be carried onto
> > >> domain
> > >> >B, so this value could be written into our database and the sales

> > credit
> > >> will
> > >> >go to our specific agents.
> > >> >
> > >> >When we pass our cookie value from domain A to domain B, I used the
> > >> >javascript. that's why I am asking th question. I am trying to think

> > about
> > >> >another way which will be better for search engine.
> > >> >Thank you.
> > >> >--
> > >> >Betty
> > >> >
> > >> >
> > >> >"Brynn" wrote:
> > >> >
> > >> >> On Nov 21, 3:47 pm, c676228 <(E-Mail Removed)> wrote:
> > >> >> > Hi all,
> > >> >> > Is there an easier way to handle that? I used Javascript to handle
> > >> this when
> > >> >> > our two domains are hosted on two different servers(on different
> > >> networks)
> > >> >> > and our search engine marketing people don't like the javascript

> > links
> > >> since
> > >> >> > they think the links are not favorable to a search robot.
> > >> >> >
> > >> >> > Now our company is thinking about hosting these two domians on the

> > same
> > >> >> > server,
> > >> >> > So I am wodering if there is any easy way to do that. Would you
> > >> provide me
> > >> >> > some clues?
> > >> >> > Thank you so much.
> > >> >> > --
> > >> >> > Betty
> > >> >>
> > >> >> I would also be interested in knowing what you are storing in those
> > >> >> cookies.
> > >> >>
> > >> >> I have changed almost everything over to server side data storage,
> > >> >> including shopping carts, etc... all on my servers.
> > >> >>
> > >> >> The only thing the cookie does for me is keeps them unique for me. If
> > >> >> I wanted them to be on 2 domains ... during a login process I would
> > >> >> simply have a data pass to a cookie on the other domain. I like to use
> > >> >> invisible iframes in my pages for passes like that.
> > >> >>
> > >> >> I had one project that I wanted to keep a session alive between 2
> > >> >> sites even ... I think I used a 1px by 1px iframe in the footer of
> > >> >> both websites that was a blank design asp webpage.
> > >> >>
> > >> >> Anyway, let us know more about what you are doing between them,
> > >> >>
> > >> >> Brynn Curry
> > >> >>
> > >> >
> > >>
> > >>
> > >

> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Making a server on one domain the domain controller of a new domain Limited Wisdom MCSA 7 09-13-2006 02:18 AM
Cookie Question (IP as domain and cookie file location) =?Utf-8?B?UGF1bA==?= ASP .Net 1 01-10-2006 08:37 PM



Advertisments