auraphp/Aura.Auth

Session could not resume

Closed this issue · 1 comments

Hey Paul,

Was trying to test, and found the session is not getting resumed.

<?php
require __DIR__ . '/vendor/autoload.php';
$dsn = 'mysql:host=localhost;dbname=auraauth';
$user = 'user';
$pass = 'password';
$dbh = new PDO($dsn, $user, $pass);

echo " Session ";
var_dump($_SESSION);

$auth_factory = new \Aura\Auth\AuthFactory();
$user = $auth_factory->newUser(
    $_COOKIE
);

$user->resumeSession();

echo " Is annonymous ";
var_dump($user->isAnon());

echo " Is idle ";
var_dump($user->isIdle());

echo " Is expired ";
var_dump($user->isExpired());

$cols = array(
    'username',
    'password',
    'id',
    'email',
    'fullname',
    'website',
    'twitter'
);

$from = 'users';
$where = 'active = 1';

$pdoadapter = $auth_factory->newPdoAdapter(
    $dbh,
    PASSWORD_BCRYPT,
    $cols,
    $from,
    $where
);
$cred = array(
    'username' => 'harikt',
    'password' => '123456'
);

$pdoadapter->login($user, $cred);

echo " Is vlaid ? ";
var_dump($user->isValid());

echo " Session ";
var_dump($_SESSION);

echo "Cookie";
var_dump($_COOKIE);

Sorry, probably I missed to figure it. This is working.