# \_session\_id and form\_for

**URL:** <https://www.ruby-forum.com/t/session-id-and-form-for/152482>\
**Category:** Rails\
**Created:** [November 4, 2008, 1:15pm UTC](https://www.ruby-forum.com/t/session-id-and-form-for/152482 "2008-11-04T13:15:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tatyree](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f14d63/32.png) [@tatyree](https://www.ruby-forum.com/u/tatyree)\
**Post date:** [November 4, 2008, 1:15pm UTC](https://www.ruby-forum.com/t/session-id-and-form-for/152482/1 "2008-11-04T13:15:49Z")

</div>

Hi,

I’ve got a mobile enabled app that needs to be able to pass  
\_session\_id for certain phones/operators that cannot/will not handle  
cookies. I’ve outlined the problem here and given the code here:

[http://pastie.org/307103](http://pastie.org/307103)

Basically, I cannot get form\_for to pick up the \_session\_id on cookie-  
less sessions unless I override it. When I do override form\_for to  
have it pass \_session\_id as a hidden param, the default\_url\_options  
override then starts working and adding the session\_id to the form  
action url. This then breaks the controller when the form is  
submitted (‘Only get, put, and delete requests are allowed.’).

Any thoughts, insights or suggestions would be appreciated.

---

<div class="post-metadata">

**Author:** ![tatyree](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/f14d63/32.png) [@tatyree](https://www.ruby-forum.com/u/tatyree)\
**Post date:** [November 4, 2008, 1:35pm UTC](https://www.ruby-forum.com/t/session-id-and-form-for/152482/2 "2008-11-04T13:35:10Z")

</div>

Found a partial solution, that I’ve added to pastie. Still having  
trouble getting hold of the session ID from the post, however.
