We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Get $ _SESSION

Hello! I have an old site that works on sessions. session set is very simple:

...
$_SESSION['uid'] = $auth['uid'];
...

I want to gradually move it to phalcon. But I can not get a session from the old framework

var_dump($this->session->id);

Result NULL. Old framework generates a session file with the name: 'sess _ 00aeb1c8e630f2ff6890840b1f39ff63' Phalcon have generated other names: 'c6e1b5c3e5fe643981299cbd60aad5ed'

whether it is possible to get something from the old framework session?

The only way to access a different session is to know the session id.

I don't believe Phalcon generates a new session if one already exists. Is the Phalcon code running in the same application as the old framework? $_SESSION['uid'] should be accessible everywhere.



4.3k

Yes, phalcon works in the same directory as the old framework. htaccess through customized routing subdirectory phalcon I pointed to the example of what the file names and generates $ _ SESSION phalcon session they differ.

The only way to access a different session is to know the session id.

I don't believe Phalcon generates a new session if one already exists. Is the Phalcon code running in the same application as the old framework? $_SESSION['uid'] should be accessible everywhere.



4.3k

Resolve https://forum.phalcon.io/discussion/20387/bug-session-prefix-fail-sess-phalcon-404.

phalcon default does not add a prefix to the session files