Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Preventing same cookies twice
Message
De
13/07/2016 02:57:50
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 5.0
OS:
Windows 10
Database:
MS SQL Server
Divers
Thread ID:
01638282
Message ID:
01638305
Vues:
40
>Hi everybody,
>
>I'm trying to go to the root of the problem. We're creating an ASP.NET MVC application.
>
>I see the following code
>
>
>DateTime expirationDate = DateTime.Now.AddMinutes(lockTime);
>
>            System.Web.HttpCookie timeoutCookie = new System.Web.HttpCookie(
>                SysManagerConstants.AUTH_TIMEOUT_COOKIE_KEY,
>                expirationDate.ToLongTimeString());
>
>            timeoutCookie.Expires = expirationDate;
>
>            timeoutCookie.Path = "/";
>
>            filterContext.HttpContext.Response.Cookies.Add(timeoutCookie);
>
>Under certain scenarios I'm getting an error (when I am debugging the code) that the filterContext can not be modified after it was being sent.
>
>I am not sure how to prevent this situation, e.g. that code executing in some sort of a loop.
>
>So, the idea is to prevent this situation of appending something when the context already sent.
>
>Thanks in advance.

Where is this code ? And do you see the problem when you are *not* debugging ?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform