Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Single Sign-on SignOut problem : FormsAuthentication.SignOut() is not working

I used the Single Sign-on demo from: http://www.codeproject.com/KB/aspnet/SingleSignon.aspx

And I add a SignOut function for this demo, but found a problem:

when I set the cookie.Domain, FormsAuthentication.SignOut() is not working and the cookie can not be cleared.

If the cookie has not been set the cookie.Domain, FormsAuthentication.SignOut() works.

I used C# asp.net.

And could anybody tell me some simple and practical Single Sign-On and Single Sign-Off solutions using asp.net ?

like image 230
Mike108 Avatar asked Nov 10 '09 12:11

Mike108


People also ask

What does Formsauthentication SignOut do?

The SignOut method removes the forms-authentication ticket information from the cookie or the URL if CookiesSupported is false . You can use the SignOut method in conjunction with the RedirectToLoginPage method to log one user out and allow a different user to log in.

Which method is used to sign out from the forms authentication?

Signout() method is used to sign out from the forms authentication.


1 Answers

In case you are using the authentication for the same domain and subdomain, try adding the domain name in the web.config instead of adding the domain through code. you will no have to code anything if you use this web.config entry

<authentication mode="Forms">

   <forms loginUrl="~/Account/LogOn" timeout="2880" domain="abc.com"/>

</authentication>

This entry tells the asp.net engine that the authentication cookie will be used for all subdomains of abc.com . Try using this and see if it works.

like image 188
Ravinder Singh Avatar answered Nov 15 '22 09:11

Ravinder Singh