diff --git a/OpenAuth.App/SSO/SSOAuthUtil.cs b/OpenAuth.App/SSO/SSOAuthUtil.cs index f34d64b2..14aace9c 100644 --- a/OpenAuth.App/SSO/SSOAuthUtil.cs +++ b/OpenAuth.App/SSO/SSOAuthUtil.cs @@ -52,7 +52,7 @@ namespace OpenAuth.App.SSO { UserName = model.UserName, Token = Guid.NewGuid().ToString().GetHashCode().ToString("x"), - InvalidTime = DateTime.Now.AddMinutes(10), + InvalidTime = DateTime.Now.AddDays(1), AppKey = model.AppKey, CreateTime = DateTime.Now, IpAddress = HttpContext.Current.Request.UserHostAddress diff --git a/OpenAuth.App/SSO/SSOController.cs b/OpenAuth.App/SSO/SSOController.cs index 2f21a9e3..bec7c68a 100644 --- a/OpenAuth.App/SSO/SSOController.cs +++ b/OpenAuth.App/SSO/SSOController.cs @@ -16,6 +16,7 @@ // // *********************************************************************** +using System; using System.Web; using System.Web.Mvc; @@ -36,7 +37,11 @@ namespace OpenAuth.App.SSO if (request.QueryString[Token] != null) { token = request.QueryString[Token]; - filterContext.HttpContext.Response.Cookies.Add(new HttpCookie(Token, token)); + var cookie = new HttpCookie(Token, token) + { + Expires = DateTime.Now.AddDays(1) + }; + filterContext.HttpContext.Response.Cookies.Add(cookie); } else if (request.Cookies[Token] != null) //从Cookie读取Token { diff --git a/OpenAuth.Mvc/Views/Designer/Index.cshtml b/OpenAuth.Mvc/Views/Designer/Index.cshtml index d4cc5988..4ba13ac2 100644 --- a/OpenAuth.Mvc/Views/Designer/Index.cshtml +++ b/OpenAuth.Mvc/Views/Designer/Index.cshtml @@ -2,15 +2,15 @@ Layout = null; } - - + + - - - - - + + + + +