For some reason i doubt that. If you call a c program that starts another program via a system call do you expect the second program to have access to the variables of the first program. when you say
I did not say I did. I have done that by passing a variable to the new program
I don't consider the cgi scripts and associated modules as "different programs"
That aside, it is working perfectly using Storable
So like any other cgi program update_tables.cgi needs to check its cookies and load its session object to find out data associated with the users session.
I could have done that but chose another way
I do appreciate the assistance from you and others in the monks
I am sorry that I did not make myself clear but I thought my repeated references to and interface between units (modules)was defining.
I don't understand how you can say all I have shown you is open connection: I have repeatedly posted
sub Main {
my $action = $query->param('action');
{
#warn("Request for LoginForm manage_users.cgi: '$action'");
($action eq "getloginform") && do {
manageusers::OpenConnection();
#warn("Just before ProcessLoginRequest - create session = '$qu
+ery'");
my ($result,$message0,$message1,$message2) = ProcessLoginReque
+st($query);
warn("result = '$result' message0 = '$message0' message1 =
+ '$message1' message2 = '$message2'");
if(!$result){
#warn("Tell client that login failed");
manageusers::CloseConnection();
LoginUserFailedForm("The Login Request failed due to some i
+nternal errot. Please try again or contact the office.");
exit(0);
#return; #exit;
}
elsif ($result == 1) {
warn("Already logged in so send client already logged in for
+m This is in the initial action GetLoginForm");
manageusers::CloseConnection();
CreateAlreadyLoggedinForm($message0);
exit (0);
#return;
}
elsif ($result == 2){
#warn("Not logged in so send client login form");
manageusers::CloseConnection();
CreateLoginForm($message0, $message1, $message2);
exit(0);
#return; #exit;
}
};
and
sub ProcessLoginRequest
{
my ($query) = @_;
my $status = 0;
my $sid = GetUserSessionCookie();
# warn("ProcessLoginRequest Query: '$query'");
# warn("ProcessLoginRequest SID from cookie: '$sid'");
#Check if it got valid return from fetch cookie
if ($sid ne 0){
$status = 1;
}
#or, check if valid return from cgi query
elsif($query){
# if (exists $query{$sessionname}){
$sid = $query->param($sessionname);
if ($sid){
#warn("ProcessLogin Request SID from Query: '$sid'");
$status = 1;
}
else{
$sid = undef;
$status = 2;
}
}
else {
#Set up for creating a new session
$sid = undef;
$status = 2;
}
warn("SID befor new session : '$sid'");
$session = new CGI::Session("driver:MySQL", $sid, {Handle=>$dbh});
#warn("session = '$session'");
OpenSession($dbh,$sid);
$session->param("#<expires>#",0);
$session->param("isloggedin",0);
$session->flush();
$sid = $session->id();
#warn("ProcessLogin Request SID from from session create: '$sid'");
my $sessiondata1 = $sid; #id created by CGI::Session;
|