Skip to Content
author's profile photo Former Member
Former Member

Why I can't get cookies' values?

I want to get session id which stores in cookies,the I write a simple xsjs:

var output = "";
var cookies = $.request.cookies;
var name;
for (name in cookies) {
     output += "name:" + name + ",value" + JSON.stringify(cookies[name]) + "<br>";
}
$.response.contentType = "text/html";
$.response.setBody(output);

Then I run the xsjs, after login, the browser shows:

name:0, value:{"name":"xsIdD2BEE...", value:""}
name:1,value:{"name":"sapxslb",value:""}

Which means I can get cookies' keys ("xsIdD2BEE" and "sapxslb"),but cookies' values are empty.

I can see the values in chrome's developer panel and they are not empty.

Can any one tell me how can I get cookies' values?

Thank you very much!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 07, 2016 at 12:59 PM

    I am having the same issue. Did anyone find a solution to this?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.