Package com.expositds.ars.model

Examples of com.expositds.ars.model.Session


    SessionEntity sessionEntity = sessionRepository.findByUserId(user
        .getId());

    // Creating or updating user's session
    Session session = createOrUpdateSession(user, sessionEntity);

    HttpSession httpSession = request.getSession(true);
    httpSession.setAttribute("session", session);

    // Create cookie option
View Full Code Here


    cookie.setPath("/");
    response.addCookie(cookie);
  }

  private Session createOrUpdateSession(User user, SessionEntity sessionEntity) {
    Session session = null;

    if (sessionEntity != null) {
      session = DozerHelper.map(sessionEntity, Session.class);
      session.setActive(true);
    } else {
      String md5hash = MD5(user.getEmail() + ":" + user.getPassword());
      session = new Session(md5hash, (User) user, true);

      sessionEntity = DozerHelper.map(session, SessionEntity.class);
      sessionEntity.setId(user.getId());
      sessionEntity = sessionRepository.merge(sessionEntity);
      session = DozerHelper.map(sessionEntity, Session.class);
View Full Code Here

TOP

Related Classes of com.expositds.ars.model.Session

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.