2 seperate appls on the same server but runs only one

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??

-Dhaval

On 13 May 2008, at 14:19, Dhaval P. wrote:

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

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?

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.

-Dhaval

On 13 May 2008, at 14:39, Dhaval P. wrote:

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

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?

-Dhaval

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?

-Dhaval

On 13 May 2008, at 15:47, Dhaval P. wrote:

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

On 13 May 2008, at 16:10, Dhaval P. wrote:

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

Another thing is to use IE to access one, and Firefox to access
another.
If its a cookie problem/session problem, it will “work”.
You are storing your session in the database?

@fred
yes, i’ve restarted both apls after changes suggested. mainly this
appl is targeted at IE7 users only so didn’t chk sessions in the
firefox, rather i don’t know how to chk that in firefox though. i also
chkd the log but couldn’t understand the prb from that.

@ 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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs