title: Logout Button doesn't work (session invalidate)
body: <p>Hy!</p>
  
  <p>I have a jsp site called konto (engl. account)
  At the end i have a button that should invalidate the current session by clicking and redirect back to the loginpage but that doesn't work.</p>
  
  <p>Code:</p>
  
  <pre><code>&lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
  &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
     "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;jsp:useBean id="konto" scope="session" class="at.korn.web.Konto"&gt;&lt;/jsp:useBean&gt;
  &lt;% if (session.getAttribute("user")== null)
      {
  %&gt;
      &lt;jsp:forward page="index.jsp"&gt;&lt;/jsp:forward&gt;
  
  &lt;% }
  if (request.getParameter("logout")!= null)
      {
      session.invalidate();
      %&gt;
      &lt;jsp:forward page="index.jsp"&gt;&lt;/jsp:forward&gt;
     &lt;% } %&gt;
  
  &lt;% konto.holeKontostand(String.valueOf( session.getAttribute("user")));%&gt;
  
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
          &lt;title&gt;Konto&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;h1&gt;Kontoübersicht&lt;/h1&gt;
          &lt;p&gt;Herzlich Willkommen &lt;% out.print(session.getAttribute("user"));%&gt; &lt;/p&gt;
          &lt;p&gt;Ihr Kontostand beträgt: ${konto.ktostand} &lt;/p&gt;
          &lt;input type="submit" value="Logout" name="logout" /&gt;
          &lt;br&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The Error should be in that file. 
  Please help!</p>