/// <summary> /// Expire the Session (and Ticket the ticket) /// </summary> public void SessionExpired() { FormsAuthentication.SignOut(); string url = request.Url.ToString(); response.Redirect(url); }
/// <summary> /// Login the session if possible /// </summary> public void Execute() { NameValueCollection queryString = requestWrapper.QueryString; string amplaSession = queryString["amplaSession"]; if (!string.IsNullOrEmpty(amplaSession)) { if (amplaUserService != null) { string message; AmplaUser amplaUser = amplaUserService.SessionLogin(amplaSession, out message); if (amplaUser != null) { formsAuthenticationService.StoreUserTicket(amplaUser, false); amplaSessionStorage.SetAmplaSession(amplaUser.Session); UriBuilder builder = new UriBuilder(requestWrapper.Url); var query = HttpUtility.ParseQueryString(builder.Query); query.Remove("amplaSession"); builder.Query = query.ToString(); responseWrapper.Redirect(builder.ToString()); } } } }