You'd want to use a shared database that both servers are accessing, or shared redis/memcached for session storage. Then it won't matter which server they are actually on. Since csrf tokens are stored in session, it should clear that up too using a common session store.
Aug 20, 2017
1
Level 1
Running laravel on multiple EC2 Servers
Hi. I am using 2 AWS EC2 to run laravel applications. After I setup the Amazon SSL and loadbalancer for 2 EC2, the login doesnt work. it repeats redirecting. I am using cookie for session not file sessions.
'driver' => env('SESSION_DRIVER', 'cookie'),
Everytime i redirect, XSRF-TOKEN and laravel_session cookies are changing.
I sometimes get TokenMismatchException error.
Do i have to set up seomthing for sessions? can we store session files to S3?
Thanks.
Please or to participate in this conversation.