Note that there are some explanatory texts on larger screens.

plurals
  1. PORails 3.2 session cookies in cookie_store get deleted after redirect to external urls
    primarykey
    data
    text
    <p>We are facing a weird problem where-in few keys/cookies are getting deleted/missing from the session in our rails 3.2 app (staging environment) which has the following cache settings/configuration. The session store is cookie store and has been configured as follows:</p> <pre><code> Appsrv::Application.config.session_store :cookie_store, { :key =&gt; 'SSID', :path =&gt; '/', :domain =&gt; APP_CONFIG['site_url'].sub(/^https?:\/\//, ""), :expire_after =&gt; 30.minutes, :secret =&gt; 's23asdfe443534afdgstreggv234324we434', :secure =&gt; false # cookie not for just https } </code></pre> <p>The rails cache store is a memcache store and we use dalli gem to integrate rails and memcache. </p> <p>The following configuration has been added to different .rb files: </p> <pre><code> config.cache_store = :dalli_store, 'staging01:11211', 'staging02:11211', 'staging03:11211', 'staging04:11211' {:namespace =&gt; "appsrv", :expires_in =&gt; 86400, :compression =&gt; true} config.action_controller.perform_caching = true </code></pre> <p>The flow where this scenario of missing cookies happens is a bit complicated though. The scenario where this happens is as follows:</p> <ol> <li>User starts a session by visiting a page on Appsrv(rails 3.2 app, some variables identifying user transaction are set in session at this time)</li> <li>Goto external website for auth.</li> <li>External website redirects to a Java App server after successful auth.</li> <li>Java App server records the auth and redirects back to Appsrv. </li> <li>But after this redirection the session variables set in step 1 are gone.</li> </ol> <p>Some weird findings: Things work perfectly in the development environment where the only difference is:</p> <pre><code> config.action_controller.perform_caching = false </code></pre> <p>If we have the same setting in staging "config.action_controller.perform_caching=false" then staging also works fine. Even with "config.action_controller.perform_caching" set to false, caching actually happens properly in controllers and models.</p> <p>So the questions are: 1. Why do the session cookies get deleted when the config.action_controller.perform_caching is set to true? 2. What is the significance of config.action_controller.perform_caching configuration if setting it to false also allows cache to happen properly?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload