我正在尝试在SSP应用程序(Netsuite应用程序)中设置响应cookie,我添加了如下代码
response.setHeader("Set-Cookies", "tc=tc;path=/");
nlapiSetRedirectURL('EXTERNAL', session.getSiteSettings(['touchpoints']).touchpoints.login);但是它不工作,并给出错误,就像
错误400: SSS_INVALID_HEADER一个或多个标头无效。
有人知道如何在Netsuite SSP应用程序中设置cookie吗
发布于 2017-02-27 03:12:46
您尝试使用HTTP标头在SSP应用程序中设置cookies有什么特殊原因吗?
您可以改用document.cookie:
<script>
document.cookie = 'tc=tc;path=/
</script>更新
如果您正在使用自定义域进行结帐,它应该可以工作。否则,您不能在不同的域之间设置cookie,但您可以尝试将cookie作为参数传递:
nlapiSetRedirectURL('EXTERNAL',session.getSiteSettings(['touchpoints']).touchpoints.login + '?tc=VALUE');
然后读取checkout.ssp中的参数:
var tcCookieValue = request.getParameter('tc')
并使用document.cookie创建cookie
https://stackoverflow.com/questions/42456333
复制相似问题