Share session between two rails 4 application with different subdomain
<p>I have two rails 4 application running on shared parent domain <code>example.com</code>(<code>pdf.example.com</code> and <code>studio.example.com</code>). The applications are deployed on AWS and storing session in shared Memcached.</p>

<p>On a page of <code>studio.example.com</code>, a page of <code>pdf.example.com</code> is loaded in <code>iframe</code> which covers the entire visible area. Now when user interacts with iframe content, session created in <code>studio.example.com</code> should reset in a sense that timeout should not happen in <code>studio.example.com</code> while sitting in pdf.example.com` pages. </p>

<p>The <code>studio.example.com</code> application uses devise for authentication.</p>

<p>Here is the configuration used to store session in memcached in <code>studio.example.com</code></p>

<p><strong>config/initializers/session_store.rb</strong></p>

<pre><code>Rails.application.config.session_store ActionDispatch::Session::CacheStore, :expire_after =&gt; 30.minutes
</code></pre>

<p><strong>config/environments/production.rb</strong>
<strong>config/environments/development.rb</strong></p>

<pre><code>config.cache_store = :dalli_store
</code></pre>

<p>There are many resources out there(few listed below) addressing this scenario but all of them are using <code>CookieStore</code>. What sort of configuration would be different for <code>CacheStore</code>?</p>

<ol>
<li><a href="http://dev.mikamai.com/post/75476602797/sharing-session-between-your-rails-4x-app-and" rel="nofollow">http://dev.mikamai.com/post/75476602797/sharing-session-between-your-rails-4x-app-and</a></li>
<li><a href="http://excid3.com/blog/sharing-a-devise-user-session-across-subdomains-with-rails-3/" rel="nofollow">http://excid3.com/blog/sharing-a-devise-user-session-across-subdomains-with-rails-3/</a></li>
<li><a href="https://robots.thoughtbot.com/how-to-share-a-session-between-sinatra-and-rails" rel="nofollow">https://robots.thoughtbot.com/how-to-share-a-session-between-sinatra-and-rails</a></li>
</ol>

<p><strong>EDIT</strong>
Exact scenario was discussed <a href="https://groups.google.com/forum/#!topic/plataformatec-devise/YD70YLFOyzs" rel="nofollow">here</a> earlier.</p>