... $session = new CGI::Session("driver:File",undef,{'Directory'=>"$session_dir"}) or die "$!"; ### write the Session-variables $session->param('name', 'ulf'); $session->expire('+2h'); ### Send the linked cookie to the client $id = $session->id(); print "Set-Cookie: session=$id; domain=$ENV{'HTTP_HOST'}; path=/\n"; ### Session-data saving... $session->flush(); ...