trotter (owner)

Revisions

gist: 144743 Download_button fork
public
Public Clone URL: git://gist.github.com/144743.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    # 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