<?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>How to get session attribute from different RESt builder different APIs?</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119307576" />
  <subtitle>How to get session attribute from different RESt builder different APIs?</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119307576</id>
  <updated>2026-04-17T01:15:26Z</updated>
  <dc:date>2026-04-17T01:15:26Z</dc:date>
  <entry>
    <title>RE: How to get session attribute from different RESt builder different APIs</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119308717" />
    <author>
      <name>Christoph Rabel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119308717</id>
    <updated>2020-06-03T17:04:43Z</updated>
    <published>2020-06-03T17:04:43Z</published>
    <summary type="html">When you use rest calls, the application is usually the client and the application state is then held in the browser. The other option is to store only a key in the application and the rest of the information in the database.&lt;br /&gt;Even if you find a momentary way around this, e.g. by using a cache or singleton + hash, believe me, it probably will bite you later on.</summary>
    <dc:creator>Christoph Rabel</dc:creator>
    <dc:date>2020-06-03T17:04:43Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to get session attribute from different RESt builder different APIs</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119308277" />
    <author>
      <name>RAVI RAJAMANI</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119308277</id>
    <updated>2020-06-03T13:08:22Z</updated>
    <published>2020-06-03T13:08:22Z</published>
    <summary type="html">&lt;div class="quote-title"&gt;David H Nebinger:&lt;/div&gt;&lt;blockquote&gt;&lt;br /&gt;You should not do this. The APIs are intended to be stateless. They are not built to support maintaining state across calls.&lt;/blockquote&gt;Is there any other way to achieve like this ? </summary>
    <dc:creator>RAVI RAJAMANI</dc:creator>
    <dc:date>2020-06-03T13:08:22Z</dc:date>
  </entry>
  <entry>
    <title>RE: How to get session attribute from different RESt builder different APIs</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119304696" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119304696</id>
    <updated>2020-06-03T12:36:22Z</updated>
    <published>2020-06-03T12:36:22Z</published>
    <summary type="html">You should not do this. The APIs are intended to be stateless. They are not built to support maintaining state across calls.</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2020-06-03T12:36:22Z</dc:date>
  </entry>
  <entry>
    <title>How to get session attribute from different RESt builder different APIs?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119307575" />
    <author>
      <name>RAVI RAJAMANI</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119307575</id>
    <updated>2020-06-03T12:22:18Z</updated>
    <published>2020-06-03T12:22:18Z</published>
    <summary type="html">&lt;blockquote&gt;How to get session attributes from different modules , &lt;strong&gt;RESTbuilder API&lt;/strong&gt; modules.&lt;br /&gt;&lt;br /&gt;say &lt;strong&gt;Module1 &lt;/strong&gt;and &lt;strong&gt;Module2&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In &lt;strong&gt;Module1&lt;/strong&gt; i had saved session value like below&lt;br /&gt;&lt;br /&gt;HttpSession httpSession = &lt;strong&gt;contextHttpServletRequest&lt;/strong&gt;.getSession(true);&lt;br /&gt;httpSession.setAttribute(&amp;#34;fooKey&amp;#34;, &amp;#34;fooValue&amp;#34;);&lt;br /&gt;&lt;br /&gt;In &lt;strong&gt;Module2&lt;/strong&gt; i had getting session value like below&lt;br /&gt;HttpSession httpSession = &lt;strong&gt;contextHttpServletRequest&lt;/strong&gt;.getSession(true);&lt;br /&gt;String value = (String) httpSession.getAttribute(&amp;#34;fooKey&amp;#34;)&lt;br /&gt;System.out.println(value); // null is coming&lt;br /&gt;Getting null , cannot able to &lt;strong&gt;getAttribute&lt;/strong&gt; from different module&lt;br /&gt;&lt;/blockquote&gt;</summary>
    <dc:creator>RAVI RAJAMANI</dc:creator>
    <dc:date>2020-06-03T12:22:18Z</dc:date>
  </entry>
</feed>
