Set the last_login and date_joined before creating.
328645
function preSave($create = false)
    {
        if (! ($this->id > 0)) {
            $this->last_login = gmdate('Y-m-d H:i:s');
            $this->date_joined = gmdate('Y-m-d H:i:s');
        }
    }
356613
public function addLoginAttempt()
    {
        RevisionRepository::create([
            'revisionable_type' => Config::get('sentry.users.model'),
            'revisionable_id'   => $this['user_id'],
            'key'               => 'last_attempt_at',
            'old_value'         => $this['last_attempt_at'],
            'new_value'         => new DateTime(),
            'user_id'           => null,
        ]);

        parent::addLoginAttempt();
    }
476308
public function addLoginAttempt()
	{
		$this->attempts++;
		$this->last_attempt_at = new DateTime;

		if ($this->getLoginAttempts() >= static::$attemptLimit)
		{
			$this->suspend();
		}
		else
		{
			$this->save();
		}
	}
1159144
function (login_id, session, data) {

	// acknowledge as 'logined'	
	l_loginID[login_id] = data.account;
	
	// init session
	session['_account'] = data.account;
	
	// TODO: needs to fix this, should read "groups" from DB
	session['_groups'] = data.groups;
	session['_permissions'] = data.permissions;
	session['lastStatus'] = data.lastStatus;
	
	// TODO: centralize handling of logined users?
	//SR.User.addGroup(user_data.account, ['user', 'admin']);
}
124584
def update_time_login(u_name):
        '''
        
        '''
        entry = TabMember.update(
            time_login=tools.timestamp()
        ).where(
            TabMember.user_name == u_name
        )
        entry.execute()
67204
def set_created_at
      self.created_at ||= DateTime.now.in_time_zone(Time.zone) if Dynamoid::Config.timestamps
    end
672537
def _login(self, user, provider=None, remember=False, force=False, **attrs):
        
        user.last_login_at = datetime.datetime.now()
        user.last_login_provider = provider or self.options["default_auth_provider_name"]
        user.last_login_from = request.remote_addr
        populate_obj(user, attrs)
        save_model(user)
        flask_login.login_user(user, remember=remember, force=force)
643540
def _last_values(self):
        
        if not self.session.get('last_request_uri'):
            self.session.last_request_uri = None
        self.session.last_request_at = self.session.get('last_request_at', 0)
1034510
def initialize(self, id, timestamp=None, user=None, page=None,
                   comment=None, type=None, action=None, text=None,
                   params=None, deleted=None):

        self.id = int(id)
        

        self.timestamp = none_or(timestamp, Timestamp)
        """
        log item timestamp : :class:`mwtypes.Timestamp`
        """

        self.user = none_or(user, User)
        """
        Contributing user metadata : :class:`mwtypes.User`
        """

        self.page = none_or(page, self.Page)
        """
        Related page : :class:`mwtypes.log_item.Page`
        """

        self.comment = none_or(comment, str)
        """
        Comment left with log item : `str`
        """

        self.type = none_or(type, str)
        """
        Type of log item : `str`
        """

        self.action = none_or(action, str)
        """
        Action of log item : `str`
        """

        self.text = none_or(text, str)
        """
        Content of text : `str`
        """

        self.params = none_or(params, str)
        """
        Content of params : `str`
        """

        self.deleted = none_or(deleted, self.Deleted)
        """
        The deleted/suppressed status of the log item.
        """
970504
public function onBeforeWrite() {
		parent::onBeforeWrite();
		if(!$this->isInDb()) {
			$this->_isCreating = true;
			$this->extend('onBeforeCreate');
		}
		if($this->isChanged('MemberID')) {
			$this->extend('onMemberLinked');
		}
	}
1266492
function() {
    this.creationTime = undefined;
    this.lastModTime = undefined;
    this.lastAccessTime = undefined;
    this.expiryTime = undefined;
    this.expires = undefined;
    this.usageCount = undefined;
    this.locationChanged = new Date();
    Object.preventExtensions(this);
}
248562
public void setLastReservationDateTime(com.google.api.ads.admanager.axis.v201811.DateTime lastReservationDateTime) {
        this.lastReservationDateTime = lastReservationDateTime;
    }
617460
public function actionLastLogins()
    {
        return UserLogin::find()->select(['user_id', 'max(timestamp_create) as maxdate'])->joinWith(['user' => function ($q) {
            $q->select(['id', 'firstname', 'lastname']);
        }])->limit(10)->groupBy(['user_id'])->orderBy(['maxdate' => SORT_DESC])->asArray()->all();
    }
982312
private boolean setUpdated(Date lastUpdateTime) {
        // Because there is no gaurantee of order of delivery,
        // we want to ensure that we do not set the updated time if it was
        // earlier than the current updated time
        if (updated == null || updated.compareTo(lastUpdateTime) < 0) {
            updated = lastUpdateTime;
            return true;
        }
        return false;
    }
762910
def _set_log_view(self, session):
        """"""
        if self._log_view == FEDERATED:
            try:
                session.use_federated_log_view()
            except AttributeError:
                pass
        else:
            try:
                session.use_isolated_log_view()
            except AttributeError:
                pass
394553
def prepare_request(self, kwargs):
        
        if self.session_id is not None:
            actual = dt.datetime.now()

            if (self.last_activity + self.inactivity_limit) < actual:
                # session expired
                if self.persist:
                    # request new session
                    self.create_session()
                    actual = dt.datetime.now()
                else:
                    # raise error and recommend to manualy refresh session
                    raise RuntimeError('A non Persistent Session is expired. '
                                       'For consistency reasons this exception is raised. '
                                       'Please try again with manual refresh of the session ')
            self.last_activity = actual

            headers = kwargs.get('headers')
            if headers is None:
                kwargs['headers'] = headers = {}
            headers['workbook-session-id'] = self.session_id
567740
def join(self):
        """"""
        self._root_state.join()
        # execution finished, close execution history log file (if present)
        if len(self._execution_histories) > 0:
            if self._execution_histories[-1].execution_history_storage is not None:
                set_read_and_writable_for_all = global_config.get_config_value("EXECUTION_LOG_SET_READ_AND_WRITABLE_FOR_ALL", False)
                self._execution_histories[-1].execution_history_storage.close(set_read_and_writable_for_all)
        from rafcon.core.states.state import StateExecutionStatus
        self._root_state.state_execution_status = StateExecutionStatus.INACTIVE