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.

[Solved] Where are Phalcon Session files (Adapter/Files) Stored?

Hi, i'm trying to use the default Session adapter of phalcon without success... i'm not unable to debug as the service initialization fail silently... anyway i get a Call to undefined method Phalcon\DI\Service::get()

when i try to get a session var via $this->di->session->get("myvar");

Any help?

PS. also, i've tried to investigate the C sources of phalcon diregtly on GitHub but i've not understood where exact implementation of functions are... For example in the Session Adapter i've found this line:


where phalcon_session_start is implemented?


I've solved partially. Now the session wok. The problem was the session service wasn't called from DI with di->get but with di->getService.

Anyway the questions are still valid:

  • where the session file is stored?
  • where are the implementations of the C methods called in the Phalcon .c sources?

edited Oct '14

Phalcon\Session\Adapter\Files is just an object-oriented wrapper to the _SESSION super-global and some functions specified here:

phalcon_session_start is the same as session_start but without doing the function lookup in the PHP userland.

You can control where the sessions are stored using:

Oh, ok, good to know! I thought you had your own implementation of sessions.

What about the second question? Just for future investigation and curiosity...

Thanks for the help!

OMG, i'm absolutely burnout... for today i should stop working.

Thanks very much for the help!

Hope this will help someonelse too.

edited Oct '14

If you use linux, you can find your session files in /tmp. Like /tmp/sess_akdanfcrfc7dgpm7afbe82k952

Session works... set in DI

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


$this->session->set("user-name", "Michael");

in one action, and read in other action

$user = $this->session->get('user-name');