# Sessions problem

**URL:** <https://www.ruby-forum.com/t/sessions-problem/169637>\
**Category:** Rails\
**Created:** [June 6, 2009, 2:29am UTC](https://www.ruby-forum.com/t/sessions-problem/169637 "2009-06-06T02:29:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![milandobrota](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@milandobrota](https://www.ruby-forum.com/u/milandobrota)\
**Post date:** [June 6, 2009, 2:29am UTC](https://www.ruby-forum.com/t/sessions-problem/169637/1 "2009-06-06T02:29:01Z")

</div>

When I deploy the application and set session variables in controller, I  
get response in browser.

test\_id = 2 and question\_id = 1Content-Type: text/html; charset=utf-8  
Set-Cookie: \_paperclip\_session=78f6281e39536254326432c524f3ace0; path=/  
Status: 302 Found  
Location: [http://www.aaaa.com/app/test/1/1](http://www.aaaa.com/app/test/1/1)  
X-Runtime: 36ms  
Content-Length: 110  
Cache-Control: no-cache

I ran rake db:sessions:create, migrated the db, uncommented  
active\_record\_store line in environment.rb and protect\_from\_forgery line  
in application.rb. What could be the issue?

The hosting is using fcgi.

---

<div class="post-metadata">

**Author:** ![milandobrota](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc29f/32.png) [@milandobrota](https://www.ruby-forum.com/u/milandobrota)\
**Post date:** [June 6, 2009, 11:58am UTC](https://www.ruby-forum.com/t/sessions-problem/169637/2 "2009-06-06T11:58:31Z")

</div>

OK, I resolved the problem. Sessions were OK, I had a print command that  
I used while developing to display some values on mongrel log, while  
here it prepended the text to the response and thus made it invalid.

Milan D. wrote:

> When I deploy the application and set session variables in controller, I  
> get response in browser.
> 
> test\_id = 2 and question\_id = 1Content-Type: text/html; charset=utf-8  
> Set-Cookie: \_paperclip\_session=78f6281e39536254326432c524f3ace0; path=/  
> Status: 302 Found  
> Location: [http://www.aaaa.com/app/test/1/1](http://www.aaaa.com/app/test/1/1)  
> X-Runtime: 36ms  
> Content-Length: 110  
> Cache-Control: no-cache
> 
> I ran rake db:sessions:create, migrated the db, uncommented  
> active\_record\_store line in environment.rb and protect\_from\_forgery line  
> in application.rb. What could be the issue?
> 
> The hosting is using fcgi.
