# Session vars vs hidden form values

**URL:** <https://www.ruby-forum.com/t/session-vars-vs-hidden-form-values/118868>\
**Category:** Rails\
**Created:** [October 31, 2007, 7:31pm UTC](https://www.ruby-forum.com/t/session-vars-vs-hidden-form-values/118868 "2007-10-31T19:31:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_M\_Lauck](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b9bd4f/32.png) [@John\_M\_Lauck](https://www.ruby-forum.com/u/John_M_Lauck)\
**Post date:** [October 31, 2007, 7:31pm UTC](https://www.ruby-forum.com/t/session-vars-vs-hidden-form-values/118868/1 "2007-10-31T19:31:10Z")

</div>

Considering a new web app that uses both ajax and standard http post  
forms depending on the situation, is it bad to use session vars to  
store user input data? The alternative to using session vars is to  
use a hidden form element or a javascript variable. Both can be  
serialized on a submit event or tweaked with some js to make this work  
(i.e. simulate hash/array’s available in ruby). Which is the “better”  
way to handle this?

I don’t need any degradation for non js browsers, js is required to  
use the site.
