Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.06 KB | None | 0 0
  1.         // Get the page info from hidden fields:
  2.         String whichPage = req.getParameter ("page");
  3.         String userName = req.getParameter("username");
  4.         Vector<String> prods = new Vector();
  5.  
  6.  
  7.         // First extract session info.
  8.         SessionInfo session = (SessionInfo) table.get(userName);
  9.  
  10.         // Check if inactive session.
  11.         if (session != null) {
  12.             long minutesSince = (System.currentTimeMillis() - session.startTime) / (1000*60);
  13.             prods = session.sessionProds;
  14.         }
  15.         else {
  16.             // Make session.
  17.             session = new SessionInfo ();
  18.             session.pageCount = 0;
  19.             session.startTime = System.currentTimeMillis ();
  20.             session.sessionProds = prods;
  21.         }
  22.  
  23.         // Determine action based on which page fired the request and
  24.         // handle in appropriate method.
  25.         if (whichPage.equalsIgnoreCase ("homepagelogin")) {
  26.             String passWord = req.getParameter("password");
  27.             handleLoginPage(out, userName, passWord);
  28.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement