views:

51

answers:

1

I have to have several certain cache-control directives set on an ASP.NET page in order to pass a Hailstorm security scan. For example, it wants me to have

Cache-control: no-cache="set-cookie"

in addition to

Cache-control: no-cache

I have been setting the latter with the following line in my C# codebehind:

Response.CacheControl = "no-cache";

Is there a special way to indicate both directives at once? Do I just separate them with a semicolon?

A: 

You can do this in the OnInit event like this:

  protected override void OnInit(EventArgs e)
        {
            Response.CacheControl = "no-cache"; 

            base.OnInit(e);
        }

Maybe a good idea to create HttpModule for this purpose.

azamsharp
Thanks, I am already doing this in the OnInit method. The question is, what is the proper way to specify multiple CacheControl directives?
strongopinions