On Feb 24, 10:23 am, Mauro
<mrsan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> If I have:
>
> class ApplicationController < ActionController::Base
> protect_from_forgery
> before_filter RubyCAS::Filter
> before_filter :fetch_operator
> include SessionsHelper
>
> private
>
> def fetch_operator
> @operator ||= session[:cas_user] &&
Operator.find_by_uid(session[:cas_user])
> log_out if @operator.nil?
> end
>
> end
>
> @operator is available for all controllers of my application.
> But If I run, for example, two instances of my application from
> different locations.
> In the first instance the user logs in as ''user1'', later
from another
> location, another user logs in as ''user2'', then in
@operator now I
> have ''user2''.
> How can I do if my application is used by more than one user?
That shouldn''t happen - each request has its own controller instance,
so setting @operator to one value for one request should have no
effect on its value for another request.
Fred
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.