atyagi / elasticache-laravel

Elasticache Session and Cache Drivers for Laravel
MIT License
25 stars 10 forks source link

Package necessity #12

Closed thewinterwind closed 9 years ago

thewinterwind commented 9 years ago

Is there a problem using the memcached driver of Laravel and connecting to elasticache servers directly?

atyagi commented 9 years ago

The main necessity is the fact that Elasticache uses a dynamic client configuration that PHP does not set on the init of the Memcached class.

thewinterwind commented 9 years ago

thanks for replying, sorry I'm not sure I understand you. Our company's app has connected to elasticache directly using memcached driver, but the problem were having is when another client logs in with the same user name as password (Laravel session) the old clients sessions are terminated.

atyagi commented 9 years ago

Hmmm, that sounds like an issue with session generation - I would check to see what parameters are sent into https://github.com/atyagi/elasticache-laravel/blob/master/src/Atyagi/Elasticache/ElasticacheSessionHandler.php#L70

My guess is that your unique ID generation for your user sessions are only unique per user and not per client and user.

thewinterwind commented 9 years ago

I mean, we are not using your package yet. This is happening using the memcached driver of Laravel and connecting directly to Elasticache. Do you know why this would happen when doing that? The team here wants to try to avoid using a package if possible, but if your package solves this problem, then using it sounds good.

thewinterwind commented 9 years ago

Ok, I understand you now. When we scaled down our elasticache cluster to one node it seems we can still use Laravel's native memcached driver and the session is persisted across multiple clients. But more than one node and the sessions drop. Thanks.