Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Changing the Cookie Domain

20 views
Skip to first unread message

aporter

unread,
May 15, 2006, 7:37:01 AM5/15/06
to
We have created a number of .Net applications for a customer and we are
trying to provide a single sign-on using forms authentication. We have given
all the applications the same machine key cookie name (.ASPXAUTH) but we also
need to set the cookie domain. How can you change the domain of the standard
.ASPXAUTH cookie that is generated by CMS?

Thankyou in advanced

Stefan [MSFT]

unread,
May 15, 2006, 8:20:31 AM5/15/06
to
Hi,

you need to set the cookie yourself.
So don't call RedirectFromLoginPage but use the SetAuthCookie method.

Cheers,
Stefan

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

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------


"aporter" <apo...@discussions.microsoft.com> wrote in message
news:40DFA20B-5C53-4397...@microsoft.com...

aporter

unread,
May 15, 2006, 12:17:03 PM5/15/06
to
Stefan,

Sorry I am not sure how you can set the cookie domain within the
SetAuthCookie() method as it only asks for a ticket, set aspnet cookie and
persist cookie.

Do you know of any examples on the web that I could look at

Cheers

Stefan [MSFT]

unread,
May 15, 2006, 12:40:05 PM5/15/06
to
Hi,

there is also a parameter "cookiePath" which should be what you are looking
for.

Cheers,
Stefan

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

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------


"aporter" <apo...@discussions.microsoft.com> wrote in message

news:B9B23A75-E39D-4675...@microsoft.com...

Stefan [MSFT]

unread,
May 15, 2006, 1:14:27 PM5/15/06
to
Hi,

just saw that this only allows to set the relative path.
Ok, then you need to request the cookie using
CmsFormsAuthentication.GetAuthCookie. This allows you to use normal ASP.NET
methods to set the cookie - including the domain.

Cheers,
Stefan

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

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------


"Stefan [MSFT]" <ste...@online.microsoft.com> wrote in message
news:%23S5354D...@TK2MSFTNGP03.phx.gbl...

aporter

unread,
May 15, 2006, 1:19:02 PM5/15/06
to
Stefan,

Thanks for the update. I still cannot get the cookie to change the domain.
If you look at the cookie information within firefox it shows the host and
not the domain i.e. host reads mysite.local where I want the cookie to have a
domain setting of local. What setting can i put in the cookie path to get
the domain and not the host

Stefan [MSFT]

unread,
May 16, 2006, 2:14:27 PM5/16/06
to
Hi,

see my parallel response.

Cheers,
Stefan

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

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------


"aporter" <apo...@discussions.microsoft.com> wrote in message

news:535EF59F-C638-4245...@microsoft.com...

Justin

unread,
Oct 31, 2009, 3:29:56 PM10/31/09
to
To accept www and no www all you need to do is add the ".yourdomain.com" to
your web.config...

<authentication mode="Forms">
<forms domain=".yourdomain.com" />
<authentication/>

url:http://ureader.com/msg/12533716.aspx

0 new messages