Forum: Ruby on Rails cookie coding problem

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.
E13ba8e702211be152c640df2d8e141f?d=identicon&s=25 Joe Black (joe-black)
on 2005-11-24 20:28
Hi, guys
My Cookie is
Cookies[:test] => {:value => "<<<joe>>>",
                   :expires => 1.day.from_now,
                   :path => "/"}
But when i open this cookie i found
value has been encoded like: %3C%3C%3Cjoe%3E%3E%3E.
I need not encode value.
How to solve this problem
Cf1ce45f343b1745f30ba70b3e208303?d=identicon&s=25 Hendie Dijkman (hendie)
on 2005-11-24 23:34
(Received via mailing list)
Joe, I think it is because cookies are passed to the browser via http,
and the text in it therefore has to be web "safe". If you used
different delimiters like --joe--, it would probably not get
"translated".
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 alex (Guest)
on 2005-11-25 09:34
(Received via mailing list)
Joe Black wrote:
>
require 'cgi'
test = CGI::unescape(cookies[:test][:value])
E13ba8e702211be152c640df2d8e141f?d=identicon&s=25 joe-black (Guest)
on 2005-11-26 13:21
thanks all of you guys.
i lost my pwd. here is joe reply
This topic is locked and can not be replied to.