Forum: Ruby on Rails Problem setting multi-value cookie

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Thiago J. (Guest)
on 2006-01-27 19:51
(Received via mailing list)
I'm trying to set a multi-value cookie but for some reason it's not
working. Any help would be appreciated.

cookies[:user] = { :value => {:email=>params[:login][:email],
:passwd=>params[:login][:passwd]}, :expires => 30.days.from_now, :path
=> "/login"}

--

Thiago J.
Kyle M. (Guest)
on 2006-01-27 21:59
(Received via mailing list)
On 1/27/06, Thiago J. <removed_email_address@domain.invalid> wrote:
>
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>

You really should be setting that in the session.  It's a particularly
bad idea to be storing a cleartext password in a cookie.

--
Kyle M.
Chief Technologist
E Factor Media // FN Interactive
removed_email_address@domain.invalid
1-866-263-3261
Thiago J. (Guest)
on 2006-01-27 22:29
Kyle M. wrote:
> On 1/27/06, Thiago J. <removed_email_address@domain.invalid> wrote:
>>
>> _______________________________________________
>> Rails mailing list
>> removed_email_address@domain.invalid
>> http://lists.rubyonrails.org/mailman/listinfo/rails
>>
>
> You really should be setting that in the session.  It's a particularly
> bad idea to be storing a cleartext password in a cookie.
>
> --
> Kyle M.
> Chief Technologist
> E Factor Media // FN Interactive
> removed_email_address@domain.invalid
> 1-866-263-3261

Well, true, but that isn't the point, the password will be md5 hashed.
The point is that it's not accepting an array as the value and I need it
to be a cookie. Any ideas?
Kyle M. (Guest)
on 2006-01-28 00:54
(Received via mailing list)
On 1/27/06, Thiago J. <removed_email_address@domain.invalid> wrote:
> > bad idea to be storing a cleartext password in a cookie.
> to be a cookie. Any ideas?
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>

I would expect that you have to serialize the data.  In Ruby that is
done using the Marshal class.

--
Kyle M.
Chief Technologist
E Factor Media // FN Interactive
removed_email_address@domain.invalid
1-866-263-3261
This topic is locked and can not be replied to.