private string SetRequestSession(IHttpRequest httpRequest) { string sessionId = null; //user already has session if (httpRequest.Cookies.ContainsCookie(HttpSessionStorage.SessionCookieKey)) { var cookie = httpRequest.Cookies.GetCookie(HttpSessionStorage.SessionCookieKey); sessionId = cookie.Value; } else // no generated session { sessionId = Guid.NewGuid().ToString(); } httpRequest.Session = HttpSessionStorage.GetSessions(sessionId); return(httpRequest.Session.Id); }