private static void SetSession(GerenciadorDeSessao gerenciador) { if (HttpContext.Current != null) { HttpContext.Current.Session[NOME_SESSAO_AUTENTICACAO] = gerenciador; } }
private static GerenciadorDeSessao ObtenhaSessao() { if (HttpContext.Current == null) { if (_gerenciador == null) { _gerenciador = new GerenciadorDeSessao(); } return(_gerenciador); } else { var gerenciador = (GerenciadorDeSessao)HttpContext.Current.Session[NOME_SESSAO_AUTENTICACAO]; if (gerenciador == null) { gerenciador = new GerenciadorDeSessao(); FormsAuthentication.SignOut(); } return(gerenciador); } }