2017 © Pedro Peláez
 

cakephp-plugin cakephp-autologin

CakePHP AutoLogin Component

image

phantomwatson/cakephp-autologin

CakePHP AutoLogin Component

  • Thursday, June 22, 2017
  • by PhantomWatson
  • Repository
  • 1 Watchers
  • 3 Stars
  • 250 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 62 % Grown

The README.md

CakePHP AutoLogin Component

Build Status, (*1)

This uses CakePHP's Cookie component in order to store a user's login data and automatically restore any sessions after they expire., (*2)

Compatibility:

Tested in CakePHP 3.0.0. This component will not work with CakePHP versions 1.x or 2.x., (*3)

Installation:

Manual installation:, (*4)

  • Download this repository and add its contents to plugins/AutoLogin

Or with Composer:, (*5)

  • Run composer require phantomwatson/cakephp-autologin in your application root

Then:, (*6)

  • Add Plugin::load('AutoLogin'); to your application's bootstrap.php (unless if you're already using Plugin::loadAll();)
  • Add $this->loadComponent('AutoLogin.AutoLogin'); to AppController::initialize() after $this->loadComponent('Auth')
  • Add $this->AutoLogin->setCookie(); after $this->Auth->setUser($user); wherever you log your users in
  • Add $this->AutoLogin->destroyCookie(); where you log your users out (e.g. in UsersController::logout())

Configuration:

This component takes the following options:, (*7)

  • autoLogin - If true, attempts to logs the user in with cookie data. (Default: true)
  • cookieKey - The name of the variable that the user's AutoLogin data is placed under in the cookie. (Default: 'autoLogin')
  • cookieSettings - An array of cookie configuration settings for overriding the existing cookie configuration for the AutoLogin cookie variable. Possible options: 'expires', 'path', 'domain', 'secure', 'key', 'httpOnly', and 'encryption'. (Default: [])
  • fields - The field names relevant to user authentication in your application. If your password field is called 'pass', you'll need to change this to something like ['username', 'pass']. (Default: ['email', 'username', 'password'])

For information about how to set these options, visit the Configuring Components section of the CakePHP 3 docs., (*8)

Note that these settings must be set in your controller's initialize() method, because AutoLogin cookie configuration and session restoration both take place before your controller's beforeFilter() method fires., (*9)

Notes:

It is strongly recommended that you use encrypted cookies. CakePHP 3 uses AES-encrypted cookies by default, so this just means don't turn off cookie encryption., (*10)

The Versions

22/06 2017

dev-master

9999999-dev https://github.com/PhantomWatson/CakePHP-AutoLoginComponent

CakePHP AutoLogin Component

  Sources   Download

MIT

The Requires

 

The Development Requires

cakephp autologin

22/06 2017

v1.1.1

1.1.1.0 https://github.com/PhantomWatson/CakePHP-AutoLoginComponent

CakePHP AutoLogin Component

  Sources   Download

MIT

The Requires

 

The Development Requires

cakephp autologin

22/06 2017

v1.1.0

1.1.0.0 https://github.com/PhantomWatson/CakePHP-AutoLoginComponent

CakePHP AutoLogin Component

  Sources   Download

MIT

The Requires

 

The Development Requires

cakephp autologin

16/12 2015

dev-development

dev-development https://github.com/PhantomWatson/CakePHP-AutoLoginComponent

CakePHP AutoLogin Component

  Sources   Download

MIT

The Requires

 

The Development Requires

cakephp autologin

16/12 2015

v1.1

1.1.0.0 https://github.com/PhantomWatson/CakePHP-AutoLoginComponent

CakePHP AutoLogin Component

  Sources   Download

MIT

The Requires

 

The Development Requires

cakephp autologin

30/04 2015

v1.0.0

1.0.0.0 https://github.com/PhantomWatson/CakePHP-AutoLoginComponent

CakePHP AutoLogin Component

  Sources   Download

MIT

The Requires

 

cakephp autologin