Things were fine (no session logout for admin from CP) when there was only one EC2 instance for our website. I created a replica of the existing EC2 instance and now when I go to Control Panel, session keeps getting expired every 30 seconds. Please help me out in order to resolve the issue. Also, what are the things I should keep in mind when I'm using multiple EC2 instances for Craft website.
1 Answer
Easiest solution: if AWS supports "sticky sessions" at the load balancer level, then you should enable to to ensure that the user gets sent back to the same EC2 instance that their session was created on.
Next easiest: create an NFS share and use https://secure.php.net/manual/en/function.session-save-path.php on all EC2 shares so all EC2 instances read/write to the same place. You'd also want to set the Craft appId and validationKey config settings to be consistent across all of the EC2 instances.
-
Thank you @Brad for the answer and also for editing the question, learnt quite a few things there. :) Commented May 5, 2017 at 2:50