#!/usr/bin/ruby
require 'cgi'
require 'cgi/session'
cgi = CGI.new("html5")
sess = CGI::Session.new( cgi, "session_key" => "a_test",
"prefix" => "rubysess.")
lastaccess = sess["lastaccess"].to_s
sess["lastaccess"] = Time.now
cgi.out{
cgi.html {
cgi.body {
"Last access time:" + lastaccess.to_s
}
}
}