title: Best way to clear session
body: <p>On my logout action I want to invalidate/clear the session and I would like to know what is the difference between these three ways to do it and which one is better:</p>
  
  <pre><code>-&gt; ActionContext.getContext().getSession().clear();
  -&gt; getHttpServletRequest().getSession().invalidate()//servlet api
  -&gt; ((org.apache.struts2.dispatcher.SessionMap) session).invalidate(); //Struts 2 SessionAware interface
  </code></pre>
  
  <p>Also, is there any difference between a struts 2's "action session" object and a servlet http session object?</p>