Developer forum

Forum » Development » Disable Set-Cookie in response header

Disable Set-Cookie in response header

Kasper Pedersen
Reply

Hello, is there any way to disable or customize the Set-Cookie in response headers on page level? I need to disable them when using an external CDN provider.


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Kasper

You can set a response header on all pages using the security setup here:

https://doc.dynamicweb.com/documentation-9/platform/advanced-settings/web-and-http#3518

If you want to set a cookie on a specific page only, you either have to do a notification subscriber or add it to the template:

I.e. You can use Dynamicweb cookie manager to support cookie opt-in settings:

var cookie = new Cookie("Name", "Value");
CookieManager.SetCookie(cookie);

or use the cookies directly:

Dynamicweb.Context.Current.Response.SetCookie
Votes for this answer: 1

 

You must be logged in to post in the forum