I have a single rail 2.2.2 app that I want to 'share' with multiple clients. Each customer has their own domain name and database. Its purpose is to allow a train app to host multiple websites.
I am using Apache as a front end of a mangrel cluster, as the web server rails to know which request is, Apache has one 'client_id' This header uses the 'client_id' to access the rail database
This works perfectly well until I reach it at the same time with only one domain name . Say 'Example1.com'
It also works fine - mostly - when many users are accessing applications with multiple domain names at the same time.
A problem I is that when two users are accessing apps with two domain names at the same time, cookies are reset in an unexpected way .
Snap down problem:
The first request is from logged in user 1 at example1.com.
The second request is for example2.com home page, user 2.
The third request is from user 1, for the second page in the application. Probably, the request includes the original cookie. The question is, why does the train send back a different cookie ???
Note, unlike many other questions, I'm not trying to share the same cookie with multiple domains. User 1 and users are accessing 2 different domains in the above example.
- John
** Example 1 example1.com ** Processing Administration :: For CMSCentrolor # INDEX (2009-01- 27 for 75.127.142.66: 13: 15:27) [GET] session ID: 00b9cfb6fd397e5c9934ea58eaef648d & gt; & Gt; & Gt; Request for client 90873721, EXAMPLE1.COM layout / admin / template rendering admin / cm / complete in list 114ms (see: 14, db: 81). 200 OK [https://example1.com/admin/cms] ** User 2 to second request for example 2 ** processing for CMSController # CMS_Show (2009-01-27 13:16:15 for 64.1.215.163) [Receive] Session ID: 4fed1c59001f7484a63fb6280376825a Parameter: {"alias" = & gt; "Home.html"}> gt; & Gt; & Gt; Request for client 48218343, EXAMPLE2.COM ### alias: home.html Provide a template in layout / two-column rendering cm / cms_show complete in 23ms (see: 13, db: 3). 200 OK [http://example2.com/] ** Example 1 for example1.com - Note 1 session ID changes !!! ** Processing Administration :: CMSCentroller # Index (For 2009-12 75.127.142.66 -27 13:16:18) [GET] Session ID: 85c178aa70ed2bef6a767e844bf6c6d6 & gt; & Gt; & Gt; Client 90873721, EXAMPLE1.COM ####### 'Admin / Cm', the request for 'index' is blocked in actionsignincontroller / admin / user on the filter chain [[check_authentication] as rendered_or_redirected. Completed in 4ms | 302 found [https://example1.com/admin/cms] ** 4th Request - Redirected to Third Request ** Processing Administration :: User Controller # Signin (2009-01-27 13:16:18 in 75.127 .142.66) [GET] Session ID: 85C178A 70702 BF 6A776A 844BF 6C6D6 & gt; & Gt; & Gt; Request for Client 90873721, EXAMPLE1.COM Layouts / Admin / Provide Template Rendering Admin / User / Signin Within Standards Complete 10 MMS (See: 6, DB: 0) | 200 OK [https://example1.com/admin/user/signin]
Well, I've solved the problem by destroying the shared monolithic cluster, and each domain has to give its own mangalal example.
I expected that I could save some server resources by sharing a single Mongol cluster, but to do this, I have to figure out how to fix this cookie problem.
By the way, I got a partial solution of "Advanced Rail Cuisine" recipe 83, "Give users their own subdomain". The recipe also explains how to give users their own domain name, but it uses a different approach than what I was trying to do.
Comments
Post a Comment