IHYPRESS.NET
RUBY
HOME | ASP | C | CSS | HTML | JAVASCRIPT | PERL | PHP | PYTHON | RUBY | SVG
Ruby (CGI Programming) ❯ Reading a Cookie
<22>
#!/usr/bin/ruby puts "Content-type: text/html\n\n" require "cgi" cgi = CGI.new("html5") cookie2 = cgi.cookies["cookiemonster1"] exists = cookie2.length.to_i if exists > 0 puts "<div style='font-size:24px;color:green;'>Cookie value: " + cookie2[0] + "</div>" else puts "<div style='font-size:24px;color:green;'>Cookie not set or expired.</div>" end
Cookie not set or expired.
COPYRIGHT © 2015-2024 IHYPRESS.NET. A DIVISION OF IHY PRESS. ALL RIGHTS RESERVED.