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.
Joe B. (Guest)
on 2005-11-24 21: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
Hendie D. (Guest)
on 2005-11-25 00: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".
alex (Guest)
on 2005-11-25 10:34
(Received via mailing list)
Joe B. wrote:
>
require 'cgi'
test = CGI::unescape(cookies[:test][:value])
joe-black (Guest)
on 2005-11-26 14:21
thanks all of you guys.
i lost my pwd. here is joe reply
This topic is locked and can not be replied to.