public void SetAuthenticationCookie(string userName, CookiePersistence cookiePersistence)
 {
     FormsAuthentication.SetAuthCookie(userName, IsCookiePersistent(cookiePersistence));
 }
        private static bool IsCookiePersistent(CookiePersistence cookiePersistence)
        {
            switch (cookiePersistence)
            {
                case CookiePersistence.SingleSession:
                    return false;

                case CookiePersistence.AcrossSessions:
                    return true;

                default:
                    // Unknown value - should this switch be updated?
                    Debugger.Break();
                    break;
            }

            // If we can't determine, default to more restrictive
            return false;
        }
 public void SetAuthenticationCookie(string userName, CookiePersistence cookiePersistence)
 {
     _setAuthenticationCookieHandler(userName, cookiePersistence);
 }