dont use user from user cookie whatsoever!!!
This commit is contained in:
parent
f48b421500
commit
c2846aed4d
3 changed files with 6 additions and 25 deletions
|
@ -15,19 +15,11 @@ internal static class HttpContextSessionExtensions
|
|||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||
};
|
||||
|
||||
public static SessionInfo GetSessionInfo(this HttpContext httpContext)
|
||||
public static string? GetSessionId(this HttpContext httpContext)
|
||||
{
|
||||
var sessionId = httpContext.Request.Cookies["sid"];
|
||||
|
||||
var userJson = httpContext.Request.Cookies["user"];
|
||||
|
||||
UserInfo? user = null;
|
||||
if (userJson is not null)
|
||||
{
|
||||
user = JsonSerializer.Deserialize<UserInfo>(userJson, JsonOptions);
|
||||
}
|
||||
|
||||
return new SessionInfo(sessionId, user?.Id);
|
||||
return sessionId;
|
||||
}
|
||||
|
||||
public static void SetSession(this HttpContext context, Session session, UserInfo user)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue