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

Change session id in Redis session adapter

Hello bird lovers,

I'm trying to integrate Phalcon with a websocket process, and I'd like to ask if any of you have tried to pull of something similar.

So far I've been using the file adapter in Phalcon and manually parsed/saved the session file in the websocket process, which was working just fine. But as you well know, file access is rather expensive, so I'm trying to move it to the Redis adapter.

Is there a way to manually change the id in session service? As a worst case scenarIo I'm thinking about extending the adapter class.

Any input is welcome, cheers!

edited Apr '16

Yes, there is.

Set session name:

https://docs.phalcon.io/en/latest/api/Phalcon_Session_Adapter_Redis.html

public setName (unknown $name) inherited from Phalcon\Session\Adapter