title: How to avoid re-login using securesocial on play framework 2?
body: <p>I am using "SecureSocial" for authentication in my project. 
  I have an issue which have been halfly answered on stack overflow, Whenever I refresh my project (because of a file change,etc), I have to re-login. Below are the related questions:</p>
  
  <ol>
  <li><p><a href="https://stackoverflow.com/questions/13179886/securesocial-fake-log-in-when-developing/18455763#18455763">Getting logged out of securesocial on compile and on clustered servers</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/9205959/getting-logged-out-of-securesocial-on-compile-and-on-clustered-servers">securesocial fake log in when developing</a></p></li>
  </ol>
  
  <p>On both questions, this behaviour is blamed on the SampleUserService which is memory-based. I can understand that. In my case, I have implemented my own UserService, which persists user login information to a database (I know it because on refreshing the project I don't have to re-register and only have to log in). This is pretty annoying and time consuming while developing. To overcome this, someone provided an answer for the <a href="https://stackoverflow.com/questions/13179886/securesocial-fake-log-in-when-developing/18455763#18455763">second question</a> as follows:</p>
  
  <blockquote>
    <p>"SecureSocial by default uses the default Play cache for storing authenticators (that match the cookies to the logged in user). The default play cache is EHCache and it's configured using the ehcache.xml that you can find in the jars. The default configuration is strictly in memory which means that when the app restarts, it loses all the values. Fortunately, it's pretty easy to overwrite the EHCache configuration to write to the disk."</p>
  </blockquote>
  
  <p>Having said above, I have the following questions:</p>
  
  <ol>
  <li><p>Suppose that I leave the EHCache settings as they are, which means that in any app  refresh, a new login is required. Now, suppose that you have 500,000 users (active and logged in) on 10 different machine and you want to do a rollout. Does this mean that all my 500,000 will have to log-in again? I don't think if reality is this, cause we had get logged out several times per week or month from facebook or linkedin etc,..., Can someone explain?</p></li>
  <li><p>Suppose that I do what is mentioned above (changing the default settings for EHCache). which means persisting the cache. Is this a right/good way to go in production? is it just a workaround for the problem mentioned while development and should not go on production. If it should not go on production, then I this right that all of my 500,000 will have to log-in again?</p></li>
  </ol>
  
  <p>If I am missing something please tell me. Maybe my questions rise from my lack of knowledge about secure social plugin. Thanks</p>