title: Accessing session scoped variable in JSTL when <%@page session="false" %>
body: <p>I have two questions,</p>
  
  <ol>
  <li><p>Can I access the session scoped variables using JSTL tags when the JSP is having <code>&lt;%@page session="false" %&gt;</code>. In my web application, I am creating a new session from servlet upon login, using <code>request.getSession()</code> and setting the attributes thereafter. However my JSP pages do not include <code>&lt;%@ page session="false" %&gt;</code> and I am using JSTL tags to display data stored in session and request. After debugging, I can see that new sessions are getting created randomly. If I add <code>&lt;%@ page session="false" %&gt;</code> to the JSP pages to ensure new sessions are not created, will there be any impact?</p></li>
  <li><p>Also, I have set a timeout of 15 mins in web.xml. Normally my application times out if there is more than 15 mins of inactivity. But occasionally, it times out in 1 or 2 minutes. I am not understanding this weird behavior. Is this related to new sessions being created. When it times out, I have seen that a new session with different session id gets created. In my code, I am detecting a timeout as follows,</p>
  
  <pre><code>if (request.getRequestedSessionId() != null
      &amp;&amp; !request.isRequestedSessionIdValid()) {
      // redirect to a login page with a message
  }
  </code></pre></li>
  </ol>