Example #1
0
  public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
    if (req.getParameter("sid") != null) {

      Session session;
      long sid;
      try {
        sid = Long.parseLong(req.getParameter("sid"));
      } catch (NumberFormatException e) {
        Send.Error(resp, "sid parse error");
        Log.sidInvalid(req);
        return;
      }
      try {
        session = new Session(sid, req);
      } catch (SecurityException e) {
        Send.Error(resp, e);
        Log.append(sid, e);
        return;
      }
      session.abandon();
    }
    Send.Data(
        resp,
        "{\"logout\":\""
            + UserServiceFactory.getUserService().createLogoutURL("close.html")
            + "\"}");
    return;
  }