I need advice for logging users in when the account information is in a
subdomain off the main domain where the login form resides.
I purchased a rails-based framework that by design uses subdomains for
accounts. So, let’s say my “main” domain where the login page is is
The way I managed login before was the form on the main home page just
for a login or email, and when an interim action handler
(SessionsController#user_login) it found a user’s account, it redirected
There a login form posting to “/session” provided the credentials inputs
log the user in. User supplies login and password, and the post works
they get logged in and redirected to their home page.
This 2 step process has proven horribly unpopular among my users and I
other reasons for wanting to truncate that process and log the user in
programmatically, e.g., at account creation they want to just be logged
and I want to redirect subscribers right to the billing page where they
can consummate a purchase.
The vendor has so far not responded to my plea for advice. Ripping the
subdomain logic out was briefly attempted, did not go well, it permeates
everything about how the framework operates.
My problem is that when I authenticate the user in the interim action
one that ordinarily just redirects to /session/new) and attempt to take
to the home page as freshly logged in users, they are mysteriously no
logged in, and it basically takes them to /session/new. Logging confirms
that they are logged_in? in this process, but once the redirect happens
the subdomain, apparently they are not. This, even if I copy the very
in the #create action that works fine when called from /session/new into
method that I call from the interim action handler
I’ve tried all kinds of different ways to simulate a post from
to /session in that action handler but no luck. I must be missing some
of information that would lead to my “Well, duh” moment but it is
right now. Is there something in the session object I can manipulate?
using cookie storage. FYI, this is Rails 2.3.2 (yes, I know about the
security problem, will apply the patch as soon as I’m done with this
Thanks in advance,