<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>reading http session attribute in javascript</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119972433" />
  <subtitle>reading http session attribute in javascript</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119972433</id>
  <updated>2026-04-05T07:54:18Z</updated>
  <dc:date>2026-04-05T07:54:18Z</dc:date>
  <entry>
    <title>RE: reading http session attribute in javascript</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119976013" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119976013</id>
    <updated>2020-09-21T06:59:07Z</updated>
    <published>2020-09-21T06:59:07Z</published>
    <summary type="html">Hi ,&lt;br /&gt;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.</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2020-09-21T06:59:07Z</dc:date>
  </entry>
  <entry>
    <title>reading http session attribute in javascript</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119972432" />
    <author>
      <name>Anindya Bagchi</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119972432</id>
    <updated>2020-09-19T16:18:32Z</updated>
    <published>2020-09-19T16:18:32Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;I have a post login hook where I have saved a http session attribute like:&amp;nbsp;&lt;br&gt;&lt;pre&gt;&lt;code&gt;session.setAttribute("agencyCode", agencyCode);
&lt;/code&gt;&lt;/pre&gt;I have a react portlet&amp;nbsp; (JS toolkit &lt;a href="https://help.liferay.com/hc/en-us/articles/360029028051-Developing-a-React-Application"&gt;https://help.liferay.com/hc/en-us/articles/360029028051-Developing-a-React-Application&lt;/a&gt;) where I want to read this attribute.&lt;br&gt;How can I do this? I was thinking of Liferay object or sessionStorage - but no luck so far.Best RegardsAnindya Bagchi&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Anindya Bagchi</dc:creator>
    <dc:date>2020-09-19T16:18:32Z</dc:date>
  </entry>
</feed>
