#!/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