Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Session becomes null

I have the same issue as where the session goes null after first time login how can I solve this?

Hey, could you paste your session code from your startup file. Its usually in index.php

Mine looks like this:

    // session
    $di->setShared('session', function() {
        $session = new \Phalcon\Session\Adapter\Files();
        return $session;

edited Nov '15

I am using the same session as INVO project.

first I use :

$di->setShared('session', function () {
    $session = new SessionAdapter();        

    return $session;

then I set the variables:

$this->session->set('auth', array(
            'id' => $user->userid,
            'name' => $user->username

then access it in acl:

$auth = $this->session->get('auth');

when I access the session in the acl the second time auth is null


I got the problem.

i removed $this->session->destroy(); in the Security plugin