#!/usr/bin/perl use CGI; use CGI::Session; my $cgi = new CGI; my $sid = $cgi->param('p'); if (defined $sid) { my $session = $session = new CGI::Session("driver:File", $sid, {Directory=>"/tmp"}); $sid = $session->id(); print "Content-Type: text/html\n\n"; print "

$sid

"; print "in if"; } else { my $session = $session = new CGI::Session("driver:File", undef, {Directory=>"/tmp"}); $sid = $session->id(); print "Content-Type: text/html\n\n"; print "

$sid

"; print "in else"; }