Thread Script setzt keine Cookies mehr: nach Server Update (11 answers)
Opened by Gast at 2003-12-09 18:16

Strat
 2003-12-10 12:16
#473 #473
User since
2003-08-04
5246 Artikel
ModeratorIn
[Homepage] [default_avatar]
4. auslesen kannst du den cookie folgendermaszen:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use CGI;
use DBI;
my $cgi = CGI->new();
my $db = DBI->connect(....) or die $DBI::errstr;
....

&checksession($cgi, $db);

sub checksession {
 my ($cgi, $db) = @_;
 my $sessionId = $cgi->cookie('sessionid');
 if ($sessionId) {
   my $sessionIdSecure = $db->quote($sessionId);
   my $statement = qq~SELECT * FROM user, access WHERE sesionId = $sessionIdSecure AND ....~;
   my $sth = $db->prepare($statement);
   unless ($sth) { # fehlerabfrage
     die "Error in preparing statement: ", $db->errstr;
   }
   unless ($sth->execute) {
     die "Error in executing statement: ", $db->errstr;
   }
# ..... usw.


} # checksesssion
\n\n

<!--EDIT|Strat|1071051421-->
perl -le "s::*erlco'unaty.'.dk':e,y;*kn:ai;penmic;;print"
http://www.fabiani.net/

View full thread Script setzt keine Cookies mehr: nach Server Update