/**
* login form
*
*/
public function index()
{
//check first if user is already logged in via session or cookie
if ($this->Auth->isLoggedIn()) {
Redirector::dashboard();
} else {
//clear and regenerate session and cookies(instead of using the existing one in browser),
//then show login form.
//But, this won't allow user(un-trusted) to open more than one login form,
//because every time it loads, it generates a new CSRF Token
//So, keep it commented
//$this->login->logOut(Session::getUserId(), true);
echo $this->view->renderWithLayouts(Config::get('LOGIN_PATH'), Config::get('LOGIN_PATH') . "index.php");
}
}