mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-07-15 23:13:40 +08:00
21 lines
590 B
C#
21 lines
590 B
C#
using System.Web;
|
|
|
|
namespace Infrastructure.Auth
|
|
{
|
|
public class CacheKey
|
|
{
|
|
public static string SessionName = "OpenAuth";
|
|
public static string UserSessionName = "Session_";
|
|
private static string GetSessionId()
|
|
{
|
|
HttpCookie cookie = HttpContext.Current.Request.Cookies.Get(SessionName);
|
|
string remoteBrowserIp = WebUtility.GetIP();
|
|
return UserSessionName + remoteBrowserIp + ":" + cookie.Value;
|
|
}
|
|
public static string UserID
|
|
{
|
|
get { return GetSessionId(); }
|
|
}
|
|
}
|
|
}
|