code: public void updateLastLoginDate(CmsDbContext dbc, CmsUser user) throws CmsException {
  
          m_monitor.clearUserCache(user);
          // set the last login time to the current time
          user.setLastlogin(System.currentTimeMillis());
          dbc.setAttribute(ATTRIBUTE_LOGIN, user.getName());
          getUserDriver(dbc).writeUser(dbc, user);
          // update cache
          m_monitor.cacheUser(user);
  
          // invalidate all user dependent caches
          m_monitor.flushCache(
              CmsMemoryMonitor.CacheType.ACL,
              CmsMemoryMonitor.CacheType.GROUP,
              CmsMemoryMonitor.CacheType.ORG_UNIT,
              CmsMemoryMonitor.CacheType.USERGROUPS,
              CmsMemoryMonitor.CacheType.USER_LIST,
              CmsMemoryMonitor.CacheType.PERMISSION,
              CmsMemoryMonitor.CacheType.RESOURCE_LIST);
  
          // fire user modified event
          Map<String, Object> eventData = new HashMap<String, Object>();
          eventData.put(I_CmsEventListener.KEY_USER_ID, user.getId().toString());
          eventData.put(I_CmsEventListener.KEY_USER_NAME, user.getName());
          eventData.put(I_CmsEventListener.KEY_USER_ACTION, I_CmsEventListener.VALUE_USER_MODIFIED_ACTION_WRITE_USER);
          eventData.put(I_CmsEventListener.KEY_USER_CHANGES, Integer.valueOf(CmsUser.FLAG_LAST_LOGIN));
          OpenCms.fireCmsEvent(new CmsEvent(I_CmsEventListener.EVENT_USER_MODIFIED, eventData));
      }
docs: Updates the last login date on the given user to the current time.<p>
  
  @param dbc the current database context
  @param user the user to be updated
  
  @throws CmsException if operation was not successful