コード例 #1
0
        public CustomJsonResult Logout(string operater, string userId, string token)
        {
            var result = new CustomJsonResult();


            SSOUtil.Quit(token);

            result = new CustomJsonResult(ResultType.Success, ResultCode.Success, "退出成功");

            return(result);
        }
コード例 #2
0
        public static void Quit()
        {
            var userInfo = GetUserInfo();

            if (userInfo != null)
            {
                SSOUtil.Quit(userInfo.Token);

                var        context        = HttpContext.Current;
                var        request        = context.Request;
                var        response       = context.Response;
                HttpCookie cookie_session = request.Cookies[OwnRequest.SESSION_NAME];
                if (cookie_session != null)
                {
                    TimeSpan ts = new TimeSpan(-1, 0, 0, 0);
                    cookie_session.Expires = DateTime.Now.Add(ts);
                    response.AppendCookie(cookie_session);
                }
            }
        }