Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello,

I am passing username using session in other page. but to redirect that page i am using session. but after i login username and password is seen on the url. How to decode it?


C#
HttpSession sess = request.getSession();
          // if(sess != null)

           //sess.invalidate();
           if (sess.getId() != null) {
               sess.setAttribute("uname", uname);
               sess.setAttribute("pwd", pwd);
           }
           String id = null;
           if (rs.next()) {
               id = rs.getString("id");
               sess.setAttribute("id", id);
               RequestDispatcher dispatcher = request.getRequestDispatcher("/mypage1.jsp");
               dispatcher.forward(request, response);
               request.setAttribute("queryResults", out);
               pw.print("<font size='6' color=blue>" + msg + "</font>");
           } else {
               String LOGIN_PAGE = "login_ml.jsp";
               response.sendRedirect(LOGIN_PAGE);
           }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900