Created
July 10, 2009 19:43
-
-
Save trotter/144743 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Convert the Cookie to its string representation. | |
| def to_s | |
| buf = "" | |
| buf += @name + '=' | |
| if @value.kind_of?(String) | |
| buf += CGI::escape(@value) | |
| else | |
| buf += @value.collect{|v| CGI::escape(v) }.join("&") | |
| end | |
| if @domain | |
| buf += '; domain=' + @domain | |
| end | |
| if @path | |
| buf += '; path=' + @path | |
| end | |
| if @expires | |
| buf += '; expires=' + CGI::rfc1123_date(@expires) | |
| end | |
| if @secure == true | |
| buf += '; secure' | |
| end | |
| buf | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment