private HttpSessionImpl getSessionInternal() { if (this.cookies == null) { return(null); } Cookie cookie = null; foreach (Cookie tempCookie in this.cookies) { if (tempCookie.getName().Equals(SESSION_COOKIE_ID)) { cookie = tempCookie; } } SessionManager manager = this.webApp.getSessionManager(); HttpSessionImpl ret = null; if (cookie != null) { ret = manager.getSession(cookie.getValue()); } return(ret); }
public HttpSessionImpl createSession() { string id = this.sessionIdGenerator.generateSessionId(); HttpSessionImpl session = new HttpSessionImpl(id); sessions.Add(id, session); return(session); }
public HttpSessionImpl getSession(string id) { HttpSessionImpl ret = sessions.get(id); if (ret != null) { ret.access(); } return(ret); }
private void cleanSessions() { foreach (string id in sessions.Keys) { HttpSessionImpl session = this.sessions.get(id); if (session.getLastAccessedTime() < DateTime.Now.Ticks - (SESSION_TIMEOUT * 60 * 1000)) { sessions.Remove(id); } } }
private HttpServletRequestImpl(string method, Map <string, string> requestHeader, HttpServletResponseImpl resp, WebApplication webApp) { this.method = method; this.cookies = parseCookies(requestHeader.get("COOKIE")); this.response = resp; this.webApp = webApp; this.session = getSessionInternal(); if (this.session != null) { addSessionCookie(); } }
public HttpSession getSession(bool create) { if (!create) { return(this.session); } if (this.session == null) { SessionManager manager = this.webApp.getSessionManager(); this.session = manager.createSession(); addSessionCookie(); } return(this.session); }