title: session get attribute of a boolean value
body: <p>In my servlet, JSP application, I've used a session variable to store log in status whether the user is logged into the system OR not.The value is a Boolean.</p>
  
  <pre><code>session.setAttribute("sess_login",true);
  </code></pre>
  
  <p>Now when i check this value in login page after log out, i get a NullPointer Exception on the below line. </p>
  
  <pre><code>boolean login=((Boolean) session.getAttribute("sess_login")).booleanValue();
  </code></pre>
  
  <p>But this works fine if i store a string value in session variable.</p>
  
  <p>Can anyone explain me the reason behind it?</p>