Once a user has logged in to EPiServer Community, how do I logg this user off?
There are (at least) two options. The first involves using the LoginStatus class in System.Web.UI.WebControls: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.loginstatus(VS.85).aspxThe control detects the user's authentication state and toggles the state of a link to log in or log out of a web site.
Behind the scenes, the LoginStatus control calls FormsAuthentication.SignOut(), which removes the authentication data from the cookie mentioned above. See MSDN on this method here: http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication.signout.aspx
Kristoffer SjöbergEPiServer AB
Also worth mentioning is the OnlineStatus-module in EPiServer Community that keeps track of which users are actually logged in to the community. You can set a user to appear offline by calling:
Otherwise the user will automatically appear offline after 20 minutes of inactivity.
The first option to use a webcontrol tp toggle log in and log out behavior is not exactly what I need, The user logs in on one webpage and loggs off on another.
Using LogOffUser seems more like it. But, when I type in StarCommunity.Modules. in VS the only thing to choose next is Forum. Am I missing an assembly or how can I find LogOffUser?
You should add the references you need to your project, they are located in the web application's "bin" directory after installation. For the OnlineStatus-module you will need to add StarCommunity.Modules.OnlineStatus.dll.
I found LogOffUser by adding a reference to the dll you mentioned. Thank you.
To do the actual log off I use FormsAuthentication.SignOut();