title: After invalidate(), is it possible to get a new session from the request object?
body: <p>After invalidation of a session, is it possible to get new session through request object  via request.getSession() without making a new request?</p>
  
  <p>My request object flow to 1st page to 2nd page and 2nd page to 1st page again 1st page to 2nd page and again same 2nd page to 2nd page ....request page can not be change but every time request 1st page to 2nd page we need to fetch detail to session and invalidate it and again created it.. 
  like this</p>
  
  <pre><code>HttpSession session = request.getsession(false)
  String user = (String)session.getAttribute("name");
  session.invalidate();
  session=request.getSession(true);
  RequestDispacher dis = request.requestDispatcher("path");
  dis.forword(request,respone);
  </code></pre>
  
  <p>but this not work on 2nd time
  it gives to null session or details</p>
  
  <p>also try to set session id in coming cookies
  like this</p>
  
  <pre><code>Cookie[] c = request.getCookies();
              for(Cookie k: c){
                  if(k.getName().equalsIgnoreCase("JSESSIONID")){
                      System.out.println("k.getValue() : "+k.getValue());
                      System.out.println("httpSession.getId() : "+httpSession.getId());
                      k.setValue(httpSession.getId());
                  }
              }
  </code></pre>