Forum: Ruby on Rails rules for passing arrays between requests

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
B0c31b2dad1edd570adff34f672e6314?d=identicon&s=25 mike (Guest)
on 2007-07-18 00:46
(Received via mailing list)
i currently have a feature on my application that requires an array
persist over multiple requests. i originally put it in a session var
and deleted it when i was done. this was great but i got to thinking
it might be better resource-wise to pass it as a paramenter. problems
arise when a redirect_to takes place. is it possible for a redirect_to
to post instead of get (it seems to not be possible according to the
docs). is there some other way or is the session approach best? thanks
in advance.

A2c85dc5ee81b12e3cc0a6522e8d079d?d=identicon&s=25 Chris Hall (au5lander)
on 2007-07-18 04:01
(Received via mailing list)
why would you think a redirect_to would cause a problem with the data
stored in the session?
B0c31b2dad1edd570adff34f672e6314?d=identicon&s=25 Michael Bannister (Guest)
on 2007-07-18 04:38
(Received via mailing list)
hi chris,

i probably didn't explain myself well. i meant to say this...

i need to have an array that persists across multiple requests.
originally i accomplished this by storing the array in the session
until i was done with it then i deleted it. i decided that that was
slightly cumbersome and possibly not efficient resource-wise. so i
tried not storing it in the session at all but instead passing it
along as a parameter via hidden form fields and query strings (with
redirect_to) but it seems to not work well because when it's passed as
a query string rails doesn't recognize it as an array anymore. i was
wondering if maybe you can make redirect_to POST instead of GET cause
then it seems i could pass my array in params without having to
convert it from a string back to an array in the controller. i figure
i'm either missing something big or small or i was on the right track
originally when i used the session approach. what do you think?

3e6bbd5a01437feec48adf3838b15d91?d=identicon&s=25 askegg (Guest)
on 2007-07-18 11:32
(Received via mailing list)
No that I am an expert, but I would stick with sessions rather than
expose your data to the users, which may raise potential security


On Jul 18, 12:37 pm, "Michael Bannister" <>
A2c85dc5ee81b12e3cc0a6522e8d079d?d=identicon&s=25 Chris Hall (au5lander)
on 2007-07-18 12:35
(Received via mailing list)
> > i need to have an array that persists across multiple requests.

that is the whole purpose of sessions.
This topic is locked and can not be replied to.