# Session data is not saved in the session file although file created 	(using :p\_store)

**URL:** <https://discuss.rubyonrails.org/t/session-data-is-not-saved-in-the-session-file-although-file-created-using-p-store/34258>\
**Category:** rubyonrails-talk\
**Created:** [September 12, 2008, 11:29am UTC](https://discuss.rubyonrails.org/t/session-data-is-not-saved-in-the-session-file-although-file-created-using-p-store/34258 "2008-09-12T11:29:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gabriel](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@Gabriel](https://discuss.rubyonrails.org/u/Gabriel)\
**Post date:** [September 12, 2008, 11:29am UTC](https://discuss.rubyonrails.org/t/session-data-is-not-saved-in-the-session-file-although-file-created-using-p-store/34258/1 "2008-09-12T11:29:33Z")

</div>

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 = { &nbsp;&nbsp;&nbsp;&nbsp;:tmpdir =\> "#{RAILS\_ROOT}/tmp/sessions/", &nbsp;&nbsp;&nbsp;&nbsp;:session\_key =\> '\_tests\_session', &nbsp;&nbsp;&nbsp;&nbsp;: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 &nbsp;&nbsp;def sec &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;session[:greeting] = "Hello world!" &nbsp;&nbsp;end end

and in a View:

\<html\> &nbsp;&nbsp;&nbsp;&nbsp;\<body\> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<p\>Session: \<%= session[:greeting] %\>\</p\> &nbsp;&nbsp;&nbsp;&nbsp;\</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!
