Jemand zu Hause?Leser: 17
1
2
3
4
5
6
7
8
9
<form id="LoginForm" action="<?login_path?>" method="post">
<label class="control-label" for="username"><small>Username</small></label>
<div><input id="focus" type="text" name="httpd_username" value="" autofocus></div>
<br>
<label class="control-label" for="password"><small>Password</small></label>
<div><input type="password" name="httpd_password" value=""></div>
<br>
<input type="submit" name="submit" value="Login">
</form>
Wie frage ich & perlintro
brian's Leitfaden für jedes Perl-Problem2020-01-11T10:08:50 GwenDragonCookies setzen mit dem Attribut SameSite...
CGI erstelltem Cookie das SameSite Attribut hinzufügen? In der Doku finde ich das Attribut gar nicht.2021-04-07T08:44:50 biancaHierzu ein paar Fragen:
* Der verlinkte Heise Artikel ist aus 2008. Und laut der Quelle Viadee gibt es das Attribut SameSite erst seit April 2016 im Rahmen des RFC 6265. Beides kann aber nicht stimmen, solange die Zeit linear in die selbe Orientierung verläuft.
Quote* iX und c't sind nicht das selbe. Gibt es einen neueren Artikel in der c't, den du verlinken wolltest oder stimmt der Text zum Link nicht?
Quote* Der verlinkte PerlMonks Artikel ist auch älter als SameSite, was war damit gemeint?
Wie frage ich & perlintro
brian's Leitfaden für jedes Perl-Problemhttps://metacpan.org/pod/CGI::CookieCreating New Cookies
Code: (dl )1
2
3
4
5
6
7
8
9my $c = CGI::Cookie->new(-name => 'foo',
-value => 'bar',
-expires => '+3M',
'-max-age' => '+3M',
-domain => '.capricorn.com',
-path => '/cgi-bin/database',
-secure => 1,
-samesite=> "Lax"
);
...
-samesite may be Lax, Strict, or None and is an evolving part of the standards for cookies. Please refer to current documentation regarding it.
CGI::Cookie
2021-04-08T08:15:43 LinuxerQuelle:CGI::Cookie
CGI::cookie auf CPAN kein Modul außer
CGI gefunden. Daher fand ich auch die Doku nicht, die Linuxer verlinkt hat.
CGI::Cookie. Seht ihr die beiden Unterschiede?
CGI::Cookie
CGI::cookie
CGI::cookie()
CGI::Cookie
CGI schauen.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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
... #### Method: cookie # Set or read a cookie from the specified name. # Cookie can then be passed to header(). # Usual rules apply to the stickiness of -value. # Parameters: # -name -> name for this cookie (optional) # -value -> value of this cookie (scalar, array or hash) # -path -> paths for which this cookie is valid (optional) # -domain -> internet domain in which this cookie is valid (optional) # -secure -> if true, cookie only passed through secure channel (optional) # -expires -> expiry date in format Wdy, DD-Mon-YYYY HH:MM:SS GMT (optional) #### sub cookie { my($self,@p) = self_or_default(@_); my($name,$value,$path,$domain,$secure,$expires,$httponly,$max_age,$samesite) = rearrange([NAME,[VALUE,VALUES],PATH,DOMAIN,SECURE,EXPIRES,HTTPONLY,'MAX-AGE',SAMESITE],@p); require CGI::Cookie; # if no value is supplied, then we retrieve the # value of the cookie, if any. For efficiency, we cache the parsed # cookies in our state variables. unless ( defined($value) ) { $self->{'.cookies'} = CGI::Cookie->fetch; # If no name is supplied, then retrieve the names of all our cookies. return () unless $self->{'.cookies'}; return keys %{$self->{'.cookies'}} unless $name; return () unless $self->{'.cookies'}->{$name}; return $self->{'.cookies'}->{$name}->value if defined($name) && $name ne ''; } # If we get here, we're creating a new cookie return undef unless defined($name) && $name ne ''; # this is an error my @param; push(@param,'-name'=>$name); push(@param,'-value'=>$value); push(@param,'-domain'=>$domain) if $domain; push(@param,'-path'=>$path) if $path; push(@param,'-expires'=>$expires) if $expires; push(@param,'-secure'=>$secure) if $secure; push(@param,'-httponly'=>$httponly) if $httponly; push(@param,'-max_age'=>$max_age) if $max_age; push(@param,'-samesite'=>$samesite) if $samesite; return CGI::Cookie->new(@param); } ...
CGI::Cookie einbindet und dessen Methoden verwendet (Zeilen 20, 26, 49 im obigen Code).
2021-04-13T19:26:42 biancaMoment!
Bitte ruft mal http://cpan.de/ auf und gebt zur Suche CGI::cookie ein.
Warum kommt da so eine doofe Anzeige mit rotem Balken?
CGI::Cookie ist das erste Ergebnis, das mir angezeigt wird. Ich sehe auch keine Anzeige mit rotem Balken; keine Ahnung, was Du da siehst.2021-04-13T21:29:47 LinuxerHab ich gemacht und lande auf der metacpan.org Suche undCGI::Cookie ist das erste Ergebnis