mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-11-08 18:34:44 +08:00
延长登陆时间
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
// </summary>
|
||||
// ***********************************************************************
|
||||
|
||||
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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user