use CGI::Carp "fatalsToBrowser"; use CGI qw(:all); use warnings; use DBI; use lib './module'; use strict; use CGI::Session; use vars qw($dbms $dbname $dbuser $dbpasswd $session $sid $dbh $lg_name); require "dbinfo.cgi"; my $cgi = new CGI; my $dbh = DBI->connect( "$dbms:$dbname","$dbuser","$dbpasswd", {PrintError => 0, RaiseError => 1}) || die "Verbindung zur Datenbank fehlgeschlagen: $DBI::errstr"; $sid = $cgi->cookie('YAMBE_SESSID') || $cgi->param('YAMBE_SESSID') || undef; $session = new CGI::Session("driver:MySQL", $sid, {Handle=>$dbh}); $session->expire('3'); $session->param("USER", $lg_name || 'gast'); my $cookie = $cgi->cookie(YAMBE_SESSID => $session->id ); print $cgi->header(-cookie=>$cookie);