<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Class: CGI::Cookie</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> <script type="text/javascript"> // <![CDATA[ function popupCode( url ) { window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") } function toggleCode( id ) { if ( document.getElementById ) elem = document.getElementById( id ); else if ( document.all ) elem = eval( "document.all." + id ); else return false; elemStyle = elem.style; if ( elemStyle.display != "block" ) { elemStyle.display = "block" } else { elemStyle.display = "none" } return true; } // Make codeblocks hidden by default document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) // ]]> </script> </head> <body> <div id="classHeader"> <table class="header-table"> <tr class="top-aligned-row"> <td><strong>Class</strong></td> <td class="class-name-in-header">CGI::Cookie</td> </tr> <tr class="top-aligned-row"> <td><strong>In:</strong></td> <td> <a href="../../files/lib/action_controller/cgi_ext/cookie_rb.html"> lib/action_controller/cgi_ext/cookie.rb </a> <br /> </td> </tr> <tr class="top-aligned-row"> <td><strong>Parent:</strong></td> <td> DelegateClass(Array) </td> </tr> </table> </div> <!-- banner header --> <div id="bodyContent"> <div id="contextContent"> </div> <div id="method-list"> <h3 class="section-bar">Methods</h3> <div class="name-list"> <a href="#M000006">http_only=</a> <a href="#M000004">new</a> <a href="#M000009">parse</a> <a href="#M000008">respond_to?</a> <a href="#M000005">secure=</a> <a href="#M000007">to_s</a> </div> </div> </div> <!-- if includes --> <div id="section"> <div id="attribute-list"> <h3 class="section-bar">Attributes</h3> <div class="name-list"> <table> <tr class="top-aligned-row context-row"> <td class="context-item-name">domain</td> <td class="context-item-value"> [RW] </td> <td class="context-item-desc"></td> </tr> <tr class="top-aligned-row context-row"> <td class="context-item-name">expires</td> <td class="context-item-value"> [RW] </td> <td class="context-item-desc"></td> </tr> <tr class="top-aligned-row context-row"> <td class="context-item-name">http_only</td> <td class="context-item-value"> [R] </td> <td class="context-item-desc"></td> </tr> <tr class="top-aligned-row context-row"> <td class="context-item-name">name</td> <td class="context-item-value"> [RW] </td> <td class="context-item-desc"></td> </tr> <tr class="top-aligned-row context-row"> <td class="context-item-name">path</td> <td class="context-item-value"> [RW] </td> <td class="context-item-desc"></td> </tr> <tr class="top-aligned-row context-row"> <td class="context-item-name">secure</td> <td class="context-item-value"> [R] </td> <td class="context-item-desc"></td> </tr> <tr class="top-aligned-row context-row"> <td class="context-item-name">value</td> <td class="context-item-value"> [RW] </td> <td class="context-item-desc"></td> </tr> </table> </div> </div> <!-- if method_list --> <div id="methods"> <h3 class="section-bar">Public Class methods</h3> <div id="method-M000004" class="method-detail"> <a name="M000004"></a> <div class="method-heading"> <a href="Cookie.src/M000004.html" target="Code" class="method-signature" onclick="popupCode('Cookie.src/M000004.html');return false;"> <span class="method-name">new</span><span class="method-args">(name = '', *value)</span> </a> </div> <div class="method-description"> <p> Creates a <a href="Cookie.html#M000004">new</a> <a href="Cookie.html">CGI::Cookie</a> object. </p> <p> The contents of the cookie can be specified as a <tt>name</tt> and one or more <tt>value</tt> arguments. Alternatively, the contents can be specified as a single hash argument. The possible keywords of this hash are as follows: </p> <ul> <li><tt>:name</tt> - The name of the cookie. Required. </li> <li><tt>:value</tt> - The cookie‘s value or list of values. </li> <li><tt>:path</tt> - The path for which this cookie applies. Defaults to the base directory of the CGI script. </li> <li><tt>:domain</tt> - The domain for which this cookie applies. </li> <li><tt>:expires</tt> - The time at which this cookie expires, as a Time object. </li> <li><tt>:secure</tt> - Whether this cookie is a secure cookie or not (defaults to <tt>false</tt>). Secure cookies are only transmitted to HTTPS servers. </li> <li><tt>:http_only</tt> - Whether this cookie can be accessed by client side scripts (e.g. document.cookie) or only over HTTP. More details in <a href="http://msdn2.microsoft.com/en-us/library/system.web.httpcookie.httponly.aspx">msdn2.microsoft.com/en-us/library/system.web.httpcookie.httponly.aspx</a>. Defaults to <tt>false</tt>. </li> </ul> <p> These keywords correspond to attributes of the cookie object. </p> </div> </div> <div id="method-M000009" class="method-detail"> <a name="M000009"></a> <div class="method-heading"> <a href="Cookie.src/M000009.html" target="Code" class="method-signature" onclick="popupCode('Cookie.src/M000009.html');return false;"> <span class="method-name">parse</span><span class="method-args">(raw_cookie)</span> </a> </div> <div class="method-description"> <p> Parses a raw cookie string into a hash of <tt>cookie-name => cookie-object</tt> pairs. </p> <pre> cookies = CGI::Cookie::parse("raw_cookie_string") # => { "name1" => cookie1, "name2" => cookie2, ... } </pre> </div> </div> <h3 class="section-bar">Public Instance methods</h3> <div id="method-M000006" class="method-detail"> <a name="M000006"></a> <div class="method-heading"> <a href="Cookie.src/M000006.html" target="Code" class="method-signature" onclick="popupCode('Cookie.src/M000006.html');return false;"> <span class="method-name">http_only=</span><span class="method-args">(val)</span> </a> </div> <div class="method-description"> <p> Sets whether the <a href="Cookie.html">Cookie</a> is an HTTP only cookie or not. </p> </div> </div> <div id="method-M000008" class="method-detail"> <a name="M000008"></a> <div class="method-heading"> <a href="Cookie.src/M000008.html" target="Code" class="method-signature" onclick="popupCode('Cookie.src/M000008.html');return false;"> <span class="method-name">respond_to?</span><span class="method-args">(method, include_private = false)</span> </a> </div> <div class="method-description"> <p> FIXME: work around broken 1.8.7 DelegateClass#respond_to? </p> </div> </div> <div id="method-M000005" class="method-detail"> <a name="M000005"></a> <div class="method-heading"> <a href="Cookie.src/M000005.html" target="Code" class="method-signature" onclick="popupCode('Cookie.src/M000005.html');return false;"> <span class="method-name">secure=</span><span class="method-args">(val)</span> </a> </div> <div class="method-description"> <p> Sets whether the <a href="Cookie.html">Cookie</a> is a secure cookie or not. </p> </div> </div> <div id="method-M000007" class="method-detail"> <a name="M000007"></a> <div class="method-heading"> <a href="Cookie.src/M000007.html" target="Code" class="method-signature" onclick="popupCode('Cookie.src/M000007.html');return false;"> <span class="method-name">to_s</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p> Converts the <a href="Cookie.html">Cookie</a> to its string representation. </p> </div> </div> </div> </div> <div id="validator-badges"> <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> </div> </body> </html>