title: values are empty in session in jsp/servlet
body: <p>I am trying to set session values as follows : </p>
  
  <pre><code>if (request.getParameter("page") != null) {
                          page = Integer.parseInt(request.getParameter("page").toString());
                      }
                      if (request.getParameter("se_tempcardnumber") != null) {
                          tempcardnumber = request.getParameter("se_tempcardnumber").toString();
                          session.setAttribute("session_tempcardnumber", tempcardnumber);
                      }
                      if (request.getParameter("se_empid") != null) {
                          empid = request.getParameter("se_empid").toString();
                          session.setAttribute("session_empid", empid);
                      }
                      if (request.getParameter("se_issuedate") != null) {
                          issuedate = request.getParameter("se_issuedate").toString();
                          session.setAttribute("session_issuedate",issuedate);
                      }
                      if (request.getParameter("se_cardstatus") != null) {
                          cardstatus = request.getParameter("se_cardstatus").toString();
                          session.setAttribute("session_cardstatus", cardstatus);
                      }
  </code></pre>
  
  <p>and i try to access the session values as follows : </p>
  
  <pre><code> if(session.getAttribute("session_empid")!=null) {
                       session_empid =(String)session.getAttribute("session_empid");
                      }
                   if(session.getAttribute("session_tempcardnumber")!=null) {
                       session_tempcardnumber =(String)session.getAttribute("session_tempcardnumber");
                      }
                   if(session.getAttribute("session_issuedate")!=null) {
                       session_issuedate =(String)session.getAttribute("session_issuedate");
                   }
                   if(session.getAttribute("session_cardstatus")!=null) {
                       session_cardstatus =(String)session.getAttribute("session_cardstatus");
                       System.out.println("session_cardstatus : "+session_cardstatus);
                   }
  </code></pre>
  
  <p>for testing purpose i set values for <code>System.out.println("session_cardstatus : "+session_cardstatus);</code> alone and i printed the same  thing. </p>
  
  <p>it is getting printed for the first time but when it comes to second time the value is empty though i don't remove anywhere those set variables in session.</p>
  
  <p>Please advise me how to go about;</p>
  
  <p>thanks and regards</p>