title: Difference between HttpServletRequest.getSession(false) and HttpSession
body: <p>I am working in an Spring MVC project, where to get values from session we have used..</p>
  
  <pre><code>session = request.getSession(false);
  Object obj = (Object) session.getAttribute("sessionVeriable");
  </code></pre>
  
  <p>Where as <code>request</code> is <code>HttpServletRequest</code> class object passed from controller.</p>
  
  <p>My point is why <code>HttpServletRequest</code> object is passed why not <code>HttpSession</code> directly. Is there any difference getting session object from HttpServletRequest and directly from HttpSession?</p>