Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Single-Signin across servers in same domain

Reply
Thread Tools

Single-Signin across servers in same domain

 
 
=?Utf-8?B?S3VsZGVlcA==?=
Guest
Posts: n/a
 
      11-05-2004
Hi,

I implemented Forms authentication for my apps (more than one). Since it'll
be hosted on a webfarm, I set cookie.domain = "nnn.nnn.com". This works fine.
I can signin and then go to other servers in same domain.

My problem is the Signout. I know FormsAuthentication.Signout() won't work
in this case. So I'm trying to explicitely expire authentication cookie. But
it won't signout and will come back every time. It's driving me crazy. Please
help. Code is given below:

code 1:
System.Web.HttpCookie cookie;
string cookieName =
System.Web.Security.FormsAuthentication.FormsCooki eName;
cookie = Request.Cookies[cookieName];
cookie.Expires = DateTime.Now.AddDays(-1);
cookie.Domain = "xxx.xxx.com";
cookie.Path = FormsAuthentication.FormsCookiePath;
Response.Cookies.Add(cookie);
Response.Redirect(Request.UrlReferrer.ToString());

I tried this also but no use:
System.Web.HttpCookie cookie;
string cookieName =
System.Web.Security.FormsAuthentication.FormsCooki eName;
int count = Request.Cookies.Count;
for(int i=0; i < count; i++)
{
cookie = Request.Cookies[i];
if(cookie.Name.Equals(cookieName))
{
cookie.Expires = DateTime.Now.AddDays(-1);
cookie.Domain = "xx.xxx.com";
cookie.Path = FormsAuthentication.FormsCookiePath;
Response.Cookies.Add(cookie);

}
}

Response.Redirect("/app/main.aspx");

 
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
VTP questions (multiple VTP servers on same domain) news8080@yahoo.com Cisco 1 05-30-2007 06:52 PM
Need same viewstate for same page across multiple servers =?Utf-8?B?UHVuaXNoZXI=?= ASP .Net 1 03-23-2006 03:54 PM



Advertisments