Message Boards

reading http session attribute in javascript

Anindya Bagchi, modified 3 Years ago.

reading http session attribute in javascript

New Member Post: 1 Join Date: 9/19/20 Recent Posts
I have a post login hook where I have saved a http session attribute like: 
session.setAttribute("agencyCode", agencyCode);
I have a react portlet  (JS toolkit https://help.liferay.com/hc/en-us/articles/360029028051-Developing-a-React-Application) where I want to read this attribute.
How can I do this? I was thinking of Liferay object or sessionStorage - but no luck so far.Best RegardsAnindya Bagchi
thumbnail
Mohammed Yasin, modified 3 Years ago.

RE: reading http session attribute in javascript

Liferay Master Posts: 591 Join Date: 8/8/14 Recent Posts
Hi ,
To access session attribute you may  need to do  it from server side only , you can make an ajax call to server and read the required info from session object.