title: HttpSession remains after server restart
body: <p>I'm learning Spring. Doing the login/logout functionality. 
  This is what my controller looks like:</p>
  
  <pre><code>@RequestMapping(value="/successfulLoginAuth", method=RequestMethod.GET)
  public ModelAndView postHttpLogin(HttpSession session, Authentication authInfo) 
  {
  
  ModelAndView mav = new ModelAndView();
  mav.setViewName("redirect:/index.html");
  session.setAttribute("authInfo", authInfo);
  
  return mav;
  
  }
  </code></pre>
  
  <p>The log in is performed via Spring Security using a dao service which I have implemented. That works fine.</p>
  
  <p>This is the content of index.jsp:</p>
  
  <pre><code>&lt;% 
      HttpSession session1 = request.getSession(false);
      Authentication authInfo; 
      if( (session1 != null) &amp;&amp; 
          ( (authInfo = (Authentication)session1.getAttribute("authInfo")) != null) 
        )
      {
  
          out.print(" yo " + authInfo.getName() + " " + authInfo.getAuthorities().iterator().next().getAuthority());
      }
      else
      {
  %&gt;    
  &lt;a href="${pageContext.request.contextPath}/registration"&gt;New? Sign Up!&lt;/a&gt;&lt;br/&gt;
  
  &lt;a href="${pageContext.request.contextPath}/login"&gt;Existing? Sign In!&lt;/a&gt;&lt;br/&gt;
  &lt;%} %&gt;
  </code></pre>
  
  <p>When i log in, and restart the server, I'm still logged in. Shouldn't the session information be lost after a server restart? If i restart the browser, it works as it should (ie the session info is lost).</p>
  
  <p>This is my Spring Security configuration:</p>
  
  <pre><code>&lt;http auto-config="true"  use-expressions="true"&gt;
          &lt;intercept-url pattern="/" access="permitAll" /&gt;
          &lt;intercept-url pattern="/logout" access="permitAll" /&gt;
          &lt;intercept-url pattern="/accessdenied" access="permitAll" /&gt;
          &lt;form-login login-page="/login" default-target-url="/successfulLoginAuth" authentication-failure-url="/accessdenied" /&gt;
          &lt;logout logout-success-url="/logout" /&gt;
      &lt;/http&gt;
  
  &lt;authentication-manager&gt;
      &lt;authentication-provider user-service-ref="myUserDetailsService"&gt;&lt;/authentication-provider&gt;
    &lt;/authentication-manager&gt;
  </code></pre>