easy-swoole / easyswoole

swoole,easyswoole,swoole framework
https://www.easyswoole.com/
Apache License 2.0
4.74k stars 510 forks source link

User sessions in multiple servers #151

Closed zilveer closed 5 years ago

zilveer commented 5 years ago

Hi everyone, a question can Easyswoole handle user sessions through multiple servers (front end ) connected to one database server ?

I am thinking of that Laravel can handle it since one can store sessions in the database, is this possible to do the same with Easyswoole ?

If not, is ther any other way to share the user sessions in multiple servers ?

Regards

id0612 commented 5 years ago

image

Session handles can be customized through the SessionHandlerInterface, through which sessions can be stored using Redis, Memcache.

zilveer commented 5 years ago

@id0612 THX, Can it be customized To use database instead ?

id0612 commented 5 years ago

Of course.

zilveer commented 5 years ago

@id0612 Thx for quick reply.but I assume that currently it is not possible with the current built in session handler right ?

id0612 commented 5 years ago

$this->session supports specifying your own session handle. See my screenshot.

id0612 commented 5 years ago

@zilveer https://secure.php.net/manual/zh/class.sessionhandlerinterface.php

id0612 commented 5 years ago

@zilveer https://github.com/easy-swoole/doc/blob/master/Manual/2.x/Cn/Other/redisSession.md