1 Eintrag, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
...
$session = new CGI::Session("driver:File",undef,{'Directory'=>"$session_dir"}) or die "$!";
### write the Session-variables
$session->param('name', 'ulf');
$session->expire('+2h');
### Send the linked cookie to the client
$id = $session->id();
print "Set-Cookie: session=$id; domain=$ENV{'HTTP_HOST'}; path=/\n";
### Session-data saving...
$session->flush();
...
1
2
3
4
5
6
7
8
9
10
...
#holt vorhandene id aus cookie, falls vorhanden...
$cookie = $request->cookie(-name=>"session");
$session = new CGI::Session("driver:File", $cookie,{'Directory'=>"$session_dir"}) or die $!;
$session->param('name', 'peter');
$session->flush();
$id = $session->id();
print "Set-Cookie: session=$id; domain=$ENV{'HTTP_HOST'}; path=/\n";
...
1 Eintrag, 1 Seite |