on 10-15-2019 6:57 PM
Hello, we need to include a beacon js in all of the pages to father some data and one of the parameters in JS is jsession Id.
Wanted to know if there is a way for JS to retrieve jsession id. We are running B2C on hybris 1808.
Thanks,
Hi,
the JSESSIONID cookie is http only. Hence, you can not read it from java script this is due to security reasons (session hijacking). Also adding the sessionid to a form or request can introduce a vulnerability to your webpage.
Maybe a token or something like that would be more suitable for your use case.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you try first getting the jSessionId in controller of that page or any handler and then pass the same to jsp (using model attribute) and put it in hidden field with some id and then get the value of the hidden field for the id in js.
Please let me know if this help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.