/// <summary> /// Gets the open token. /// </summary> /// <param name="context">The context.</param> /// <returns></returns> private MultiStringDictionary GetOpenToken(HttpContext context) { HttpRequest request = context.Request; HttpResponse response = context.Response; HttpSessionState session = context.Session; MultiStringDictionary attributes = null; var propsPath = context.Request.PhysicalApplicationPath + "/" + Constants.PFAGENT_PROPERTIES; Agent agent = new Agent(propsPath); try { attributes = agent.ReadTokenMultiStringDictionary(request); } catch (Exception e) { if (e is TokenException || e is TokenExpiredException) { agent.DeleteToken(response); response.RedirectToRoutePermanent(new RouteValueDictionary { { "controller", "Home" }, { "action", "Index" } }); } } return attributes; }