Skip to main content
Bumped by Community user
replaced http://salesforce.stackexchange.com/ with https://salesforce.stackexchange.com/
Source Link

This question relates to: Is it possible to add http headers. for example set-cookie, via ampscript or ssjs in ExactTarget?Is it possible to add http headers. for example set-cookie, via ampscript or ssjs in ExactTarget?

The answer on that question does not specifically call out how to set a cookie with SSJS, it just references the HTTPHeader.SetValue() function.

I've tried the following to set the cookie and have been unsuccessful.

HTTPHeader.SetValue("Set-Cookie","foo=bar");
HTTPHeader.SetValue("Cookie","foo=bar");

Any thoughts as to what I'm doing wrong?

This question relates to: Is it possible to add http headers. for example set-cookie, via ampscript or ssjs in ExactTarget?

The answer on that question does not specifically call out how to set a cookie with SSJS, it just references the HTTPHeader.SetValue() function.

I've tried the following to set the cookie and have been unsuccessful.

HTTPHeader.SetValue("Set-Cookie","foo=bar");
HTTPHeader.SetValue("Cookie","foo=bar");

Any thoughts as to what I'm doing wrong?

This question relates to: Is it possible to add http headers. for example set-cookie, via ampscript or ssjs in ExactTarget?

The answer on that question does not specifically call out how to set a cookie with SSJS, it just references the HTTPHeader.SetValue() function.

I've tried the following to set the cookie and have been unsuccessful.

HTTPHeader.SetValue("Set-Cookie","foo=bar");
HTTPHeader.SetValue("Cookie","foo=bar");

Any thoughts as to what I'm doing wrong?

Source Link
Daniel
  • 1.3k
  • 1
  • 19
  • 38

How to set a cookie using SSJS?

This question relates to: Is it possible to add http headers. for example set-cookie, via ampscript or ssjs in ExactTarget?

The answer on that question does not specifically call out how to set a cookie with SSJS, it just references the HTTPHeader.SetValue() function.

I've tried the following to set the cookie and have been unsuccessful.

HTTPHeader.SetValue("Set-Cookie","foo=bar");
HTTPHeader.SetValue("Cookie","foo=bar");

Any thoughts as to what I'm doing wrong?