package Sessions; use Apache::Session::MySQL; use db_lib; my %session; my ($dbh); my $db = "usrdb_help_projekt_1"; $dbh=connect_db($db) or die 'cant connect'; sub get_session{ my $session_id=shift; $session_id =~ s/ //g; tie %session, 'Apache::Session::MySQL', $session_id, { Handle => $dbh, LockHandle => $dbh }; $session{first_name} = "Chuck"; return %session; } sub new_session{ tie %session, 'Apache::Session::MySQL', undef, { Handle => $dbh, LockHandle => $dbh }; $session{first_name} = "Csdf"; return %session; }