IHYPRESS PROGRAMMING
CGI/Ruby programs with code and output for beginners
classic asp
HOME | ASP | C | CSS | GNUPLOT | 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
Hergestellt in Deutschland / Made in Germany
Cookie not set or expired.
COPYRIGHT © 2015-2024 IHY PRESS Frankfurt am Main 60329 Deutschland