OpenAuth.Net/Infrastructure/Auth/CacheKey.cs

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(); }
}
}
}