geomorillo / auth Goto Github PK
View Code? Open in Web Editor NEWAuth addon for Simple MVC Framework
Auth addon for Simple MVC Framework
Once Login in done echo $this->auth->isLogged();
returns true.
When the page changes echo $this->auth->isLogged();
returns false.
Does the errormsg[]
and successmsg[]
have any meaning as of now?
On my XAMPP 7.0.8 / PHP 7.0.8 server I revived the following error when trying to login.
setcookie() expects parameter 3 to be integer, float given in \Auth\Cookie.php on line 35
Work fine on my WAMP server and my Ubuntu 16.04 server.
Any idea how to fix this issue?
Hello,
I'm new to SMVC and found today your Auth helper. I encounter a strange behavior. I'm able to login a user, but after a page refresh, the auth_session cookie won't appear anymore.
The database session is still present and valid for a month. I saw the other issue with Chrome's related localhost bug. I tried with Chrome/Firefox, thus I'm serving pages with an other computer from my network.
Login page $_COOKIE dump:
array(2) {
["PHPSESSID"]=> string(26) "v53t4mqib1lqg1821g6eo74020"
["auth_session"]=> string(32) "12bbe0e1deb7783cb5b876166da16095"
}
Any other page after the login page:
array(1) {
["PHPSESSID"]=> string(26) "v53t4mqib1lqg1821g6eo74020"
}
Any clue, please?
Regards,
Chris.
I have been trying to get this working all day. I am using a login form that sends POST data to this login script. I can not figure it out. Any help is appreciated.
Controllers\Auth.php
<?php namespace controllers;
use \Core\View,
\Core\Controller,
\Helpers\Url,
\Helpers\Request as Request;
class Auth extends Controller {
private $auth;
public function __construct(){
parent::__construct();
$this->auth = new \Helpers\Auth\Auth();
}
// Logs the user into the system
public function Login(){
if($this->auth->isLogged()){
Url::redirect();
}
if(isset($_POST['submit'])){
// Catch username an password inputs using the Request helper
$username = Request::post('username');
$password = Request::post('password');
// Login Validation
if($this->auth->login($username, $password)){
// User is good to go
//$data = array('LastLogin' => date('Y-m-d G:i:s'));
//$where = array('id' => $this->auth->getID($username));
//$this->auth->updateUser($data,$where);
// Url::redirect();
}else{
// Bad login info
}
}
$data['title'] = 'Login';
View::rendertemplate('header',$data);
View::render('auth/Login',$data,$errormsg,$successmsg);
View::rendertemplate('footer',$data);
}
// Logs the user out of the system
public function Logout(){
$this->auth->logout();
Url::redirect();
}
}
Also in the database: activitylog I get the following:
username: UNKNOWN
action: AUTH_CHECKSESSION
additionalinfo: User session cookie deleted - Hash (36fc9404c889628c6f4b095e344ce25b) didn't exist
The sessions database is empty.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.