# Can I use session obj without cookie support in browser?

**URL:** <https://www.ruby-forum.com/t/can-i-use-session-obj-without-cookie-support-in-browser/194164>\
**Category:** Rails\
**Created:** [August 31, 2010, 1:03pm UTC](https://www.ruby-forum.com/t/can-i-use-session-obj-without-cookie-support-in-browser/194164 "2010-08-31T13:03:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 31, 2010, 1:03pm UTC](https://www.ruby-forum.com/t/can-i-use-session-obj-without-cookie-support-in-browser/194164/1 "2010-08-31T13:03:48Z")

</div>

Hi, guys:

I want to use the session object in the rails, but the browser has  
disabled the cookie support. I store some string into the session obj,  
but I can’t retrieve the string value in another page.

In there any solution to solve the problem?

I have tried add the following code on Application\_Controller to store  
my session into database, but it doesn’t work. I still can’t get the  
string value in the session obj.

I have tried add the following code on Application\_Controller to store  
my session into database.

ActionController::Base.session\_store = :active\_record\_store

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [August 31, 2010, 6:48pm UTC](https://www.ruby-forum.com/t/can-i-use-session-obj-without-cookie-support-in-browser/194164/2 "2010-08-31T18:48:05Z")

</div>

On Tue, Aug 31, 2010 at 1:12 AM, GD [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I want to use the session object in the rails, but the browser has  
> disabled the cookie support. I store some string into the session obj,  
> but I can’t retrieve the string value in another page.

Possibly helpful:

[http://oldwiki.rubyonrails.org/rails/pages/HowToMaintainSessionWhenCookiesAreNotAllowed](http://oldwiki.rubyonrails.org/rails/pages/HowToMaintainSessionWhenCookiesAreNotAllowed)

–  
Hassan S. ------------------------ removed\_email\_address@domain.invalid  
twitter: @hassan

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 1, 2010, 8:06am UTC](https://www.ruby-forum.com/t/can-i-use-session-obj-without-cookie-support-in-browser/194164/3 "2010-09-01T08:06:32Z")

</div>

Hi:

Thanks your reply very much. But The “Hidden Field Session” project is  
not available.

I think that is it possible to append the session\_id on the URL, and  
my rails  
program can get the session object by the session\_id sent from  
previous page?

It is like the JSP to rewrite the URL and append the jsessionid.

On 9æœˆ1æ—¥, ä¸Šåˆ12æ™‚38åˆ†, Hassan S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [September 1, 2010, 3:56pm UTC](https://www.ruby-forum.com/t/can-i-use-session-obj-without-cookie-support-in-browser/194164/4 "2010-09-01T15:56:03Z")

</div>

GD wrote:

> Hi:
> 
> Thanks your reply very much. But The “Hidden Field Session” project is  
> not available.
> 
> I think that is it possible to append the session\_id on the URL, and  
> my rails  
> program can get the session object by the session\_id sent from  
> previous page?
> 
> It is like the JSP to rewrite the URL and append the jsessionid.

I would think so too. It amazes me that Rails can’t do this. PHP and  
JSP have both done it for ages.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
