IHYPRESS.NET > RUBY
HOME
|
ASP
|
C
|
HTML/CSS
|
JAVASCRIPT
|
MATLAB
|
PERL
|
PHP
|
PYTHON
|
RUBY
Ruby
> Program #22 [Reading a Cookie]
CODE
RESULT
<
#!/usr/bin/ruby puts "Content-type: text/html\n\n" require "cgi" cgi = CGI.new("html4") cookie2 = cgi.cookies["cookiemonster1"] exists = cookie2.length.to_i if exists > 0 puts "
Cookie value: " + cookie2[0] + "
" else puts "
Cookie not set or expired.
" end
COPYRIGHT © 2018 IHYPRESS.NET. A DIVISION OF IHY PRESS, KIRKLAND, WA 98083 USA. ALL RIGHTS RESERVED.