#!/usr/bin/perl -w # Import the modules use strict; use CGI::Session; use CGI::Pretty qw(:standard); use HTML::Template; use DBI; # various config parameters my $host = 'localhost'; my $db = 'dem.sqlite'; my $dbtype = 'SQLite'; #my $table = 'sessions'; my $dbuname = ''; my $dbpwd = ''; my $login_limit = 3; # create a new database connection my $dbh = DBI->connect("dbi:$dbtype:$db", '', '', {PrintError => 1, RaiseError => 1}); # The session is initialized or recalled. The session allows checking whether # the user is logged in or not. my $cgi = new CGI; my $session = new CGI::Session("driver:$dbtype", $cgi, {Handle => $dbh}); my $cookie = $cgi->cookie(CGISESSID => $session->id); #### $self->{SQLite_dbh} = $args->{Handle} || DBI->connect( $args->{DataSource}, $args->{User} || undef, $args->{Password} || undef, { RaiseError=>1, PrintError=>1, AutoCommit=>1 } );