Re: Session Cookie not accessible across Sub-Domains

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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
>>
>


.



Relevant Pages

  • Re: Bug in forms authentication?
    ... Isn't the auth token saved as a cookie. ... You are right that sessions and form authentication are separated ... when I'm connecting from two IE browsers it _is ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Is it common to use session.use_trans_sid?
    ... they can just steal sessions. ... Just the contents of the session file, not the cookie. ... disabled browsers while not giving away security (since the security is ... probably savvy enough to make an exception for your site. ...
    (comp.lang.php)
  • Re: [PHP] input on sessions vs cookies
    ... the cookie data to retrieve user information.. ... to hijack sessions. ... is what PHP native sessions do. ... Why not use PHP native sessions? ...
    (php.general)
  • Re: General question on charging for data access
    ... First off, the sessions are a great idea, but what about just an MD5 or ... any other encrypted cookie? ... I think using the cookie with an xxSQL database is one of the only ways ... jblanch at gmail dot com ...
    (comp.lang.php)
  • Re: Session Cookie not accessible across Sub-Domains
    ... within applications for security, so if your subdomains were not part of the ... > I wasn't referring to sharing sessions across parent domains (e.g. ... >> will always set a new cookie as you move between domains. ... >> John Timney ...
    (microsoft.public.dotnet.framework.aspnet)