src/ChickenWire/Auth.php
public function login($username, $password)
		{

			// Get result
			$result = $this->validate($username, $password);

			// Success?
			$this->_result = $result;
			if ($result->success) {

				// Store it in the session
				$storeObject = array(
					'username' => $username,
					'password' => $result->user->readAttribute($this->_passwordField)
				);
				$_SESSION[self::$_sessionPrefix . $this->name] = $storeObject;

				// Store local vars
				$this->_authenticated = true;
				$this->_user = $result->user;

				// Save last login
				$llField = $this->_lastloginField;
				$this->user->$llField = new \ActiveRecord\DateTime();
				$this->user->save();

			

			}

			// Done.
			return $result;
			
		}
public function login($username, $password)
		{

			// Get result
			$result = $this->validate($username, $password);

			// Success?
			$this->_result = $result;
			if ($result->success) {

				// Store it in the session
				$storeObject = array(
					'username' => $username,
					'password' => $result->user->readAttribute($this->_passwordField)
				);
				$_SESSION[self::$_sessionPrefix . $this->name] = $storeObject;

				// Store local vars
				$this->_authenticated = true;
				$this->_user = $result->user;

				// Save last login
				$llField = $this->_lastloginField;
				$this->user->$llField = new \ActiveRecord\DateTime();
				$this->user->save();

			

			}

			// Done.
			return $result;
			
		}
public function login ( $ username , $ password ) { // Get result $ result = $ this -> validate ( $ username , $ password ) ; // Success? $ this -> _result = $ result ; if ( $ result -> success ) { // Store it in the session $ storeObject = array ( 'username' => $ username , 'password' => $ result -> user -> readAttribute ( $ this -> _passwordField ) ) ; $ _SESSION [ self :: $ _sessionPrefix . $ this -> name ] = $ storeObject ; // Store local vars $ this -> _authenticated = true ; $ this -> _user = $ result -> user ; // Save last login $ llField = $ this -> _lastloginField ; $ this -> user -> $ llField = new \ ActiveRecord \ DateTime ( ) ; $ this -> user -> save ( ) ; } // Done. return $ result ; }
Validate the given username and password and store
the session is authentication is successful.

@param  string $username The username for the user to validate.
@param  string $password The unencrypted password for the user to validate.
@return \ChickenWire\Auth\AuthResult           Result object containing information of authentication
Validate the given username and password and store the session is authentication is successful .