Giter Site home page Giter Site logo

auth's People

Contributors

bryanyeh avatar geomorillo avatar pixelbart avatar pokballs avatar tico973 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

auth's Issues

Auth_Session won't stay

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.

Can't get login to work properly.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.