Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8390235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:55:46+00:00 2026-06-09T18:55:46+00:00

If you are running a Rails 3 app with multiple web dynos on Heroku,

  • 0

If you are running a Rails 3 app with multiple web dynos on Heroku,

  1. Every time you hit the app, do you typically connect with a different web dyno?
  2. Can sessions work across different web dynos?
  3. Does it work for different Rails session stores (ActionDispatch::Session::CookieStore,
    ActiveRecord::SessionStore, and ActionDispatch::Session::CacheStore)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T18:55:47+00:00Added an answer on June 9, 2026 at 6:55 pm

    In short yes – sessions will work across multiple web dynos.

    Sessions work across web dynos – because Rail’s design of session support allows it to. If anything, the web dyno model is exactly how Rail’s was intended to be scaled horizontally.

    1. Every time you hit the app, do you typically connect with a different web dyno?

    Based on heroku documentation:

    The routing mesh is responsible for determining the location of your application’s web dynos within the dyno manifold and forwarding the HTTP request to one of these dynos. Dyno selection is performed using a random selection algorithm.

    So dyno selection is random… but that dyno has to have your application installed. So if you have more than one dyno, then you may end up connecting to a different dyno (which is important as this facilitates load balancing and high availability)

    2. Can sessions work across different web dynos?

    Yes. Most web stacks support sessions by doing the following:

    1. Assigning a session id – which is a unique id, and it is usually set as a session cookie so that the browser will always send the id with ANY HTTP request to the originating host
    2. Providing storage which maps the session id to the actual session data

    So by this process, sessions can be supported as every inbound HTTP request has the session ID, which is accessible by the web dyno when it handles your request.

    3. Does it work for different Rails session stores (ActionDispatch::Session::CookieStore, ActiveRecord::SessionStore, and ActionDispatch::Session::CacheStore)

    ActionDispatch::Session::CookieStore
    Yes. The cookie store stores encrypted session data as a cookie. So your browser sends all the session data (encrypted) back to the host, which is then decrypted for use within your app.

    ActiveRecord::SessionStore
    Yes. The cookie store stores encrypted session data in a database table. An ID is then assigned as a cookie. So your browser sends the ID to the host, which is then used to load the session data from the database. Since all web dynos have a connection to the DB, this means it is also supported.

    ActionDispatch::Session::CacheStore
    Yes but you need a cache store service (eg MemCache addon). The cookie store stores encrypted session data in a cache store (memcache), which is a shared service across all web dynos. An ID is then assigned as a cookie. So your browser sends the ID to the host, which is then used to load session data from the cache store (memcache).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Rails app running Mongoid on Heroku and I need to set
I have a Ruby on Rails app running on my server, and I can't
I have a single-threaded Rails app running on thin in single-threaded mode on Heroku
I have a rails app running on Heroku. I am using paperclip for some
I currently have a Rails 3.1 app that hosts multiple sites for several different
I am writing an app that has different parts running on multiple servers. As
So I was wondering, Heroku can run multiple dynos to handle a growing number
I have a rails app running a thin server on heroku. It currently uses
I'm created a Rails app running on Heroku, with Paperclip and S3. I've managed
I am setting up an Apache2 webserver running multiple Ruby on Rails web applications

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.