-Dhaval
--
Posted via http://www.ruby-forum.com/.
>
> hi,
> i've 2 appls on the server. both are of same type but with different
> DB and different ports. when i login to first appl on say port 3000
> and
> then access 2nd appl on port 3001, the first appl loggs off. so its
> like
> only one application works at a time. i've modified my.cnf for
> max_connections but that also didn't work. can somebody help in this
> please??
I suspect it's because they're both trying to store the same session
cookie. You can set the name of the session cookie used in
environment.rb (config.action_controller.session = { :session_key =>
'_foo_session', etc...})
Fred
P.S.:- those 2 appls i'm talking abt are on the PRODUCTION server. the
same type of appls work on my DEV server without any prb.
>
> Hi Fred,
> Thanks for the quick reply. but i couldn't get u. actually i'm using
> restful authentication. the line u mentioned is commented in the
> environment.rb in both the appl. but yes, both have session controller
> in common but thr also no session cookie is maintained. can u
> explain a
> bit more on this please?
>
What I was getting at was that both apps are trying to use the same
session cookie, which you can change in environment.rb
Fred
is this something to do with the rails version? i'm using 1.2.5. if yes,
is thr any alternative for that?
>
> hi Fred,
> i put "config.action_controller.session_store = {:session_key =>
> '_foo_session', :secret => 'secret-secret'}" in my env.rb file but
> that
> gave me this error-
> Status: 500 Internal Server Error Content-Type: text/html
> undefined method `new' for {:session_key=>"_foo_session",
> :secret=>"secret-secret"}:Hash
>
> is this something to do with the rails version? i'm using 1.2.5. if
> yes,
> is thr any alternative for that?
Ah yes it's probably different on 1.2.5. I used to have something like
ActionController
::CgiRequest::DEFAULT_SESSION_OPTIONS.update(:session_key =>
'foo_session')
at the bottom of environment.rb
Fred
>
> put the same line, but still no luck :(. seriously don't understand wt
> the prb is :(, hitting my head harder to work this one out... is thr
> any
> other way :o?
>
I'm sure you did this anyway, but just to check, you did set the
session key to different things for both apps and restart them? Have
you tried eyeballing your cookies in firefox to check they're not
getting remove when you don't expect them? You can see session ids in
the logs, so if they change unexpectedly that also implies the cookie
has vaporized.
Fred
@ glennswest,
yes,u r right.i'd tried this one yesterday only before i left, but
forgot to mention it here. it works on separate browsers. prb is when
both appl opened in the same browser but on separate tab. is thr any
solution for that?
abt storing session in DB, i'm not sure but i don't think so because
thrs neither any table called as session nor any field in other tables.
-D