$ENV
{
'CGI_APP_RETURN_ONLY'
} = 1;
$CGI::Session::Driver::file::FileName
=
'session.dat'
;
my
$Session_ID
;
my
$Storage_Name
=
'cap_form_state'
;
my
$Storage_Hash
;
{
BEGIN {
@ISA
=
qw(CGI::Application)
; }
sub
setup {
my
$self
=
shift
;
$self
->run_modes([
'start'
]);
$self
->session_config(
CGI_SESSION_OPTIONS
=> [
"driver:File"
,
undef
, {
Directory
=>
't'
} ],
);
$Session_ID
=
$self
->session->id;
$self
->session->param(
'foo'
, 42);
is(
$self
->session->param(
'foo'
), 42,
"["
. (
ref
$self
) .
"] new session initialized"
);
}
}
{
@WebApp1::ISA
= (
'BaseWebApp'
);
sub
start {
my
$self
=
shift
;
ok(
$self
->form_state->id,
'id autoconfigs'
);
}
}
{
@WebApp2::ISA
= (
'BaseWebApp'
);
sub
start {
my
$self
=
shift
;
ok(
$self
->form_state->name,
'name autoconfigs'
);
}
}
{
@WebApp3::ISA
= (
'BaseWebApp'
);
sub
start {
my
$self
=
shift
;
ok(
$self
->form_state->session_key,
'session_key autoconfigs'
);
}
}
WebApp1->new->run;
WebApp2->new->run;
WebApp3->new->run;
unlink
File::Spec->catfile(
't'
,
$CGI::Session::Driver::file::FileName
);