summaryrefslogtreecommitdiff
path: root/sample/cgi-session-pstore.rb
blob: ec8b4989d69b3bcfe2de71d7c5e2ab84469d09d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
require 'cgi'
require 'cgi/session/pstore'

STDIN.reopen(IO::NULL)
cgi = CGI.new
session = CGI::Session.new(cgi, 'database_manager' => CGI::Session::PStore)
session['key'] = {'k' => 'v'}
puts session['key'].class
fail unless Hash === session['key']
puts session['key'].inspect
fail unless session['key'].inspect == '{"k"=>"v"}'