Gabriel
2008-Sep-11  17:02 UTC
Session data is not saved in the session file although file created (using :p_store)
Hi all,
I am new to Rails. I want to test some things with sessions. But I
simply cannot make them work. I am using this in the environment.rb
file:
config.action_controller.session_store = :p_store
config.action_controller.session = {
    :tmpdir => "#{RAILS_ROOT}/tmp/sessions/",
    :session_key => ''_tests_session'',
    :secret      =>
''f23e19a920da3ccb0a128f24d97a85e36618b7e6dc920167febe16f24ca89462d5bf83598d87d2d842c1fd273bb7df98b23ee6291c8fe6bfe8fdcf973929b645''
}
The file "ruby_sess.d38fcbeda549de99" is created in my
"#{RAILS_ROOT}/
tmp/sessions/" directory.
In one controller I have the following code:
class SecController < ApplicationController
  def sec
      session[:greeting] = "Hello world!"
  end
end
and in a View:
<html>
    <body>
        <p>Session: <%= session[:greeting] %></p>
    </body>
</html>
....but on the web page I only find "Session:" written. I opened the
session file and the "Hello World!" string was neither there.
If I create an application with InstantRails, everything works OK. I
see the strings that I pus in the session on the view page and in the
sesion file in the /tmp/sessions directory. I tried to compare the two
applications (the one I created the one created inside InstantRails
and modified by me to use the p_store). Except the versions, I saw no
other differences.
What am I missing? Is there a switch somewhere?
(I have the latest stable versions of ruby, gems and rails)
Thanks!
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Gabriel
2008-Sep-12  11:29 UTC
Session data is not saved in the session file although file created (using :p_store)
Hi all,
I am new to Rails. I want to test some things with sessions. But I
simply cannot make them work. I am using this in the environment.rb
file:
config.action_controller.session_store = :p_store
config.action_controller.session = {
    :tmpdir => "#{RAILS_ROOT}/tmp/sessions/",
    :session_key => ''_tests_session'',
    :secret      =>
''f23e19a920da3ccb0a128f24d97a85e36618b7e6dc920167febe16f24ca89462d5bf83598d87d2d842c1fd273bb7df98b23ee6291c8fe6bfe8fdcf973929b645''
}
The file "ruby_sess.d38fcbeda549de99" is created in my
"#{RAILS_ROOT}/
tmp/sessions/" directory.
In one controller I have the following code:
class SecController < ApplicationController
  def sec
      session[:greeting] = "Hello world!"
  end
end
and in a View:
<html>
    <body>
        <p>Session: <%= session[:greeting] %></p>
    </body>
</html>
....but on the web page I only find "Session:" written. I opened the
session file and the "Hello World!" string was neither there.
If I create an application with InstantRails, everything works OK. I
see the strings that I pus in the session on the view page and in the
sesion file in the /tmp/sessions directory. I tried to compare the two
applications (the one I created the one created inside InstantRails
and modified by me to use the p_store). Except the versions, I saw no
other differences.
What am I missing? Is there a switch somewhere?
(I have the latest stable versions of ruby, gems and rails)
Thanks!
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---