# Sending an unescaped cookie

**URL:** <https://www.ruby-forum.com/t/sending-an-unescaped-cookie/123873>\
**Category:** Rails\
**Created:** [December 21, 2007, 4:34pm UTC](https://www.ruby-forum.com/t/sending-an-unescaped-cookie/123873 "2007-12-21T16:34:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![elwin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ee59a6/32.png) [@elwin](https://www.ruby-forum.com/u/elwin)\
**Post date:** [December 21, 2007, 4:34pm UTC](https://www.ruby-forum.com/t/sending-an-unescaped-cookie/123873/1 "2007-12-21T16:34:31Z")

</div>

Hello:

In my controller, I am writing a cookie and then immediately redirecting  
to an external site, as such:

cookies[:foo] = {:value =\> ‘[http://example.com](http://example.com)’}  
redirect\_to ‘[https://example.org](https://example.org)’

The site I am directing too looks for the URL set in the foo cookie in  
order to redirect back to my site. However, the cookie that is written  
is escaped so that it looks like http%3A%2F%[2Fexample.com](http://2Fexample.com). Thus the  
external application considers that the URL of an improper format. Is  
there any way to send the cookie as an unescaped string?

Thanks
