Hai!
I have two controller. the one is first_controller and another one is
second_controller.
first_controller.rb
def login
.
.
if @user && @user.password == params[:user][:password]
session[:user_id] = @user.id
redirect_to :controller => "second_controller", :action =>
"index"
end
end
second_controller.rb
def index
if session[:user_id] != nil
logger.info" The user id is not null"
else
logger.info" The user id is null"
end
end
#=======Result
The user id is not null # 1st time
The user id is null # 2nd time
The user id is not null # 3rd time
The user id is not null # 4th time
The user id is null # 5th time
The user id is not null # 6th time
The user id is not null # 7th time
The user id is not null # 8th time
The user id is not null # 9th time
The user id is not null # 10th time
The user id is not null # 11th time
The user id is null # 12th time
Here my session variable id dynamic not a static. But i want static
value.
I hope this is session problem. help me.
Thanks for you.
bdeveloper01
--
Posted via http://www.ruby-forum.com/.
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.