Re: Session Cookie not accessible across Sub-Domains
- From: "John Timney \(ASP.NET MVP\)" <timneyj@xxxxxxxxxxxxx>
- Date: Tue, 23 Aug 2005 00:36:13 +0100
sorry I misread your question (its late here!!).
You can't share sessions across domains, nor applications natively - so it
will always set a new cookie as you move between domains. Because you can
share cookies across those applications (and between those domains) one
approach is to store your shared data in a database and use a shared domain
cookie to identify the data in the database.
--
Regards
John Timney
ASP.NET MVP
Microsoft Regional Director
"Doug" <Doug@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4F98DB84-EB1C-4122-BE1F-B5C4980C1766@xxxxxxxxxxxxxxxx
> Hi John,
> Thank you for the reply. I'm not sure I understand; or perhaps vice-versa?
>
> I don't set the ASP.NET Session cookie. ASP.NET does that all on it's own.
> I
> do know how to write cookies and set domains, etc. My question is, how do
> I
> get ASP.NET to set the correct domain wherever it set its own cookie?
>
> Thanks,
> Doug
>
>
> "John Timney (ASP.NET MVP)" wrote:
>
>> When initially setting the cookie
>>
>> Response.Cookies("domain").Value = DateTime.Now.ToString
>> Response.Cookies("domain").Expires = DateTime.Now.AddDays(1)
>> Response.Cookies("domain").Domain = "mydomain.com"
>>
>> .................should do the trick.
>>
>> I think its case sensitive at the browser.
>>
>> --
>> Regards
>>
>> John Timney
>> ASP.NET MVP
>> Microsoft Regional Director
>>
>
.
- Follow-Ups:
- References:
- Session Cookie not accessible across Sub-Domains
- From: Doug
- Re: Session Cookie not accessible across Sub-Domains
- From: John Timney \(ASP.NET MVP\)
- Re: Session Cookie not accessible across Sub-Domains
- From: Doug
- Session Cookie not accessible across Sub-Domains
- Prev by Date: Re: DateTime Problem
- Next by Date: Change 2.0 Themes Dynamically When Using MasterPages?
- Previous by thread: Re: Session Cookie not accessible across Sub-Domains
- Next by thread: Re: Session Cookie not accessible across Sub-Domains
- Index(es):
Relevant Pages
|