view release on metacpan or search on metacpan
lib/CGI/Simple.pm view on Meta::CPAN
sub print {
shift;
CORE::print( @_ );
} # print to standard output (for overriding in mod_perl)
################# Cookie Methods ################
sub cookie {
my ( $self, @params ) = @_;
require CGI::Simple::Cookie;
require CGI::Simple::Util;
my ( $name, $value, $path, $domain, $secure, $expires, $httponly, $samesite )
= CGI::Simple::Util::rearrange(
[
'NAME', [ 'VALUE', 'VALUES' ],
lib/CGI/Simple.pm view on Meta::CPAN
@params
);
# retrieve the value of the cookie, if no value is supplied
unless ( defined( $value ) ) {
$self->{'.cookies'} = CGI::Simple::Cookie->fetch
unless $self->{'.cookies'};
return () unless $self->{'.cookies'};
# if no name is supplied, then retrieve the names of all our cookies.
return keys %{ $self->{'.cookies'} } unless $name;
lib/CGI/Simple.pm view on Meta::CPAN
push @params, '-path' => $path if $path;
push @params, '-expires' => $expires if $expires;
push @params, '-secure' => $secure if $secure;
push @params, '-httponly' => $httponly if $httponly;
push @params, '-samesite' => $samesite if $samesite;
return CGI::Simple::Cookie->new( @params );
}
sub raw_cookie {
my ( $self, $key ) = @_;
if ( defined $key ) {
unless ( $self->{'.raw_cookies'} ) {
require CGI::Simple::Cookie;
$self->{'.raw_cookies'} = CGI::Simple::Cookie->raw_fetch;
}
return $self->{'.raw_cookies'}->{$key} || ();
}
return $ENV{'HTTP_COOKIE'} || $ENV{'COOKIE'} || '';
}
lib/CGI/Simple.pm view on Meta::CPAN
# push all the cookies -- there may be several
if ( $cookie ) {
my @cookie = ref $cookie eq 'ARRAY' ? @{$cookie} : $cookie;
for my $cookie ( @cookie ) {
my $cs
= ref $cookie eq 'CGI::Simple::Cookie'
? $cookie->as_string
: $cookie;
push @header, "Set-Cookie: $cs" if $cs;
}
}
# if the user indicates an expiration time, then we need both an Expires
# and a Date header (so that the browser is using OUR clock)
lib/CGI/Simple.pm view on Meta::CPAN
unshift @o,
'-Status' => '302 Found',
'-Location' => $url,
'-nph' => $nph;
unshift @o, '-Target' => $target if $target;
unshift @o, '-Cookie' => $cookie if $cookie;
unshift @o, '-Type' => '';
my @unescaped;
unshift( @unescaped, '-Cookie' => $cookie ) if $cookie;
return $self->header( ( map { $self->unescapeHTML( $_ ) } @o ),
@unescaped );
}
################# Server Push Methods #################
lib/CGI/Simple.pm view on Meta::CPAN
CGI.pm alias for print. $q->print('Hello World!') will print the usual
=cut
################# Cookie Methods ################
=head1 HTTP COOKIES
CGI.pm has several methods that support cookies.
lib/CGI/Simple.pm view on Meta::CPAN
use CGI::Simple;
$q = CGI::Simple->new;
$riddle = $q->cookie('riddle_name');
%answers = $q->cookie('answers');
Cookies created with a single scalar value, such as the "riddle_name"
cookie, will be returned in that form. Cookies with array and hash
values can also be retrieved.
The cookie and CGI::Simple namespaces are separate. If you have a parameter
named 'answers' and a cookie named 'answers', the values retrieved by
B<param()> and B<cookie()> are independent of each other. However, it's
lib/CGI/Simple.pm view on Meta::CPAN
# vice-versa
$q->param( -name=>'answers', -value=>[$q->cookie('answers')] );
=head2 raw_cookie()
Returns the HTTP_COOKIE variable. Cookies have a special format, and
this method call just returns the raw form (?cookie dough). See
B<cookie()> for ways of setting and retrieving cooked cookies.
Called with no parameters, B<raw_cookie()> returns the packed cookie
structure. You can separate it into individual cookies by splitting
on the character sequence "; ". Called with the name of a cookie,
retrieves the B<unescaped> form of the cookie. You can use the
regular B<cookie()> method to get the names, or use the raw_fetch()
method from the CGI::Simmple::Cookie module.
=cut
################# Header Methods ################
lib/CGI/Simple.pm view on Meta::CPAN
CGI::Simple is strict and warnings compliant.
There are 4 modules in this distribution:
CGI/Simple.pm supplies all the core code.
CGI/Simple/Cookie.pm supplies the cookie handling functions.
CGI/Simple/Util.pm supplies a variety of utility functions
CGI/Simple/Standard.pm supplies a functional interface for Simple.pm
Simple.pm is the core module that provide all the essential functionality.
Cookie.pm is a shortened rehash of the CGI.pm module of the same name
which supplies the required cookie functionality. Util.pm has been recoded to
use an internal object for data storage and supplies rarely needed non core
functions and/or functions needed for the HTML side of things. Standard.pm is
a wrapper module that supplies a complete functional interface to the OO
back end supplied by CGI::Simple.
lib/CGI/Simple.pm view on Meta::CPAN
escapeHTML
unescapeHTML
put
print
=head2 Cookie Methods
cookie
raw_cookie
=head2 Header Methods
lib/CGI/Simple.pm view on Meta::CPAN
This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself. See L<perlartistic>.
=head1 SEE ALSO
B<CGI>, L<CGI::Simple::Standard>, L<CGI::Simple::Cookie>,
L<CGI::Simple::Util>, L<CGI::Minimal>
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Template.pm view on Meta::CPAN
my $header = "Content-type: text/html\n";
my $redirect = 0;
foreach my $i (keys %passed_hash){
if( $i =~ /-cookie/ ){
$header .= "Set-Cookie: " . $passed_hash{$i} . "\n";
} elsif( $i =~ /-content-type/ ) {
$header =~ s/text\/html/$passed_hash{$i}/;
} elsif( $i =~ /-redirect/ ) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Thin.pm view on Meta::CPAN
=back
=head1 SEE ALSO
CGI::Thin::Cookies
=head1 SUPPORT
Visit CGI::Thin's web site at
http://www.PlatypiVentures.com/perl/modules/cgi_thin.shtml
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Tiny.pm view on Meta::CPAN
}
} continue {
$i += 2;
}
Carp::croak "Newline characters not allowed in HTTP response cookie '$name'" if $cookie_str =~ tr/\r\n//;
push @{$self->{response_headers}}, ['Set-Cookie', $cookie_str];
}
return $self;
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/01.main.t view on Meta::CPAN
cd:cod:180:Congo, The Democratic Republic of the:Zaire:Congo, Democratic Republic of the
cf:caf:140:Central African Republic
cg:cog:178:Congo:Congo, Republic of the
ch:che:756:Switzerland
ci:civ:384:Cote D'Ivoire
ck:cok:184:Cook Islands
cl:chl:152:Chile
cm:cmr:120:Cameroon
cn:chn:156:China
co:col:170:Colombia
cr:cri:188:Costa Rica
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Uploader.pm view on Meta::CPAN
through a CGI application. The files are stored on the file system, and
the file attributes stored in a SQL database.
=head1 Introduction and Recipes
The L<CGI::Uploader::Cookbook|CGI::Uploader::Cookbook> provides
a slightly more in depth introduction and recipes for a basic BREAD web
application. (Browse, Read, Edit, Add, Delete).
=head1 Constructor
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Utils.pm view on Meta::CPAN
require Exporter;
@ISA = 'Exporter';
@EXPORT = ();
@EXPORT_OK = qw(urlEncode urlDecode urlEncodeVars urlDecodeVars getSelfRefHostUrl
getSelfRefUrl getSelfRefUrlWithQuery getSelfRefUrlDir addParamsToUrl
getParsedCookies escapeHtml escapeHtmlFormValue convertRelativeUrlWithParams
convertRelativeUrlWithArgs getSelfRefUri);
$EXPORT_TAGS{all_utils} = [ qw(urlEncode urlDecode urlEncodeVars urlDecodeVars
getSelfRefHostUrl
getSelfRefUrl getSelfRefUrlWithQuery getSelfRefUrlDir
addParamsToUrl getParsedCookies escapeHtml escapeHtmlFormValue
convertRelativeUrlWithParams convertRelativeUrlWithArgs
getSelfRefUri)
];
=pod
lib/CGI/Utils.pm view on Meta::CPAN
$url .= $self->urlEncodeVars($param_hash, $sep);
return $url;
}
*add_params_to_url = \&addParamsToUrl;
sub _getRawCookie {
my $self = shift;
if ($self->_isModPerl) {
my $r = $self->_getApacheRequest;
return $r ? $r->headers_in()->{Cookie} : ($ENV{HTTP_COOKIE} || $ENV{COOKIE} || '');
}
else {
return $ENV{HTTP_COOKIE} || $ENV{COOKIE} || '';
}
}
=pod
=head2 getParsedCookies()
Parses the cookies passed to the server. Returns a hash of
key/value pairs representing the cookie names and values.
Aliases: get_parsed_cookies
=cut
sub getParsedCookies {
my ($self) = @_;
my %cookies = map { (map { $self->urlDecode($_) } split(/=/, $_, 2)) }
split(/;\s*/, $self->_getRawCookie);
return \%cookies;
}
*get_parsed_cookies = \&getParsedCookies;
# added for v0.06
# for compatibility with CGI.pm
# may want to create an object here
sub cookie {
lib/CGI/Utils.pm view on Meta::CPAN
my $map_list = [ 'name', [ 'value', 'values' ], 'path', 'expires', 'domain', 'secure' ];
my $params = $self->_parse_sub_params($map_list, \@args);
if (exists($$params{value})) {
return $params;
} else {
my $cookies = $self->getParsedCookies;
if ($cookies and %$cookies) {
return $$cookies{$$params{name}};
}
return '';
}
lib/CGI/Utils.pm view on Meta::CPAN
'content_type'. The arguments may also be passed CGI.pm style
with a '-' in front, e.g.
print $cgi_obj->getHeader( -content_type => 'text/html', -expires => '+3d' );
Cookies may be passed with the 'cookies' key either as a string,
a hash ref, or as a CGI::Cookies object, e.g.
my $cookie = { name => 'my_cookie', value => 'cookie_val' };
print $cgi_obj->getHeader(cookies => $cookie);
You may also pass an array of cookies, e.g.,
lib/CGI/Utils.pm view on Meta::CPAN
my $cookies = $$params{cookie};
if (defined($cookies) and $cookies) {
my $cookie_array = ref($cookies) eq 'ARRAY' ? $cookies : [ $cookies ];
foreach my $cookie (@$cookie_array) {
# handle plain strings as well as CGI::Cookie objects and hashes
my $str = '';
if (UNIVERSAL::isa($cookie, 'CGI::Cookie')) {
$str = $cookie->as_string;
} elsif (ref($cookie) eq 'HASH') {
$str = $self->_createCookieStrFromHash($cookie);
} else {
$str = $cookie;
}
push @$headers, "Set-Cookie: $str" unless $str eq '';
}
}
if (defined($$params{expires})) {
my $expire = $self->_canonicalizeHttpDate($$params{expires});
lib/CGI/Utils.pm view on Meta::CPAN
*local_redirect = \&getLocalRedirect;
*get_local_redirect = \&getLocalRedirect;
=pod
=head2 getCookieString(\%hash), get_cookie_string(\%hash);
Returns a string to pass as the value of a 'Set-Cookie' header.
=cut
sub getCookieString {
my ($self, $hash) = @_;
return $self->_createCookieStrFromHash($hash);
}
*get_cookie_string = \&getCookieString;
=pod
=head2 getSetCookieString(\%params), getSetCookieString([ \%params1, \%params2 ])
Returns a string to pass as the 'Set-Cookie' header(s), including
the line ending(s). Also accepts a simple hash with key/value pairs.
=cut
sub getSetCookieString {
my ($self, $cookies) = @_;
if (ref($cookies) eq 'HASH') {
my $array = [ map { { name => $_, value => $cookies->{$_} } } keys %$cookies ];
$cookies = $array;
}
my $cookie_array = ref($cookies) eq 'ARRAY' ? $cookies : [ $cookies ];
my $headers = [];
foreach my $cookie (@$cookie_array) {
# handle plain strings as well as CGI::Cookie objects and hashes
my $str = '';
if (UNIVERSAL::isa($cookie, 'CGI::Cookie')) {
$str = $cookie->as_string;
} elsif (ref($cookie) eq 'HASH') {
$str = $self->_createCookieStrFromHash($cookie);
} else {
$str = $cookie;
}
push @$headers, "Set-Cookie: $str" unless $str eq '';
}
# FIXME: make line endings work on windoze
return join("\r\n", @$headers) . "\r\n";
}
*get_set_cookie_string = \&getSetCookieString;
=pod
=head2 setCookie(\%params), set_cookie(\%params);
Sets the cookie generated by getCookieString. That is, in a
mod_perl environment, it adds an outgoing header to set the
cookie. In a CGI environment, it prints the value of
getSetCookieString to STDOUT (including the end-of-line
sequence).
=cut
sub setCookie {
my $self = shift;
my $params = shift;
my $str = $self->_createCookieStrFromHash($params);
my $r = $self->_getApacheRequest;
if ($r) {
$r->err_headers_out()->add('Set-Cookie' => $str);
}
else {
print STDOUT "Set-Cookie: $str\r\n";
}
}
*set_cookie = \&setCookie;
sub _createCookieStrFromHash {
my ($self, $hash) = @_;
my $pairs = [];
my $map_list = [ 'name', [ 'value', 'values', 'val' ],
'path', 'expires', 'domain', 'secure',
lib/CGI/Utils.pm view on Meta::CPAN
push @$pairs, qq{path=$path};
push @$pairs, qq{domain=$$params{domain}} if $$params{domain};
if ($$params{expires}) {
my $expire = $self->_canonicalizeCookieDate($$params{expires});
push @$pairs, qq{expires=$expire};
}
push @$pairs, qq{secure} if $$params{secure};
return join('; ', @$pairs);
}
sub _canonicalizeCookieDate {
my ($self, $expire) = @_;
return $self->_canonicalizeDate('-', $expire);
}
sub _canonicalizeHttpDate {
view all matches for this distribution
view release on metacpan or search on metacpan
($newBody, $newHeaders, $stat) = ob_gzhandler($body, $headers);
$status = $stat;
}
# Run callback if defined. Callback may set additional cookies
# printing Set-Cookie header. If callback returns 0, no data
# is output by this function (presume callback did it itself).
if ($callback) {
$callback->($newBody, $newHeaders, $body) or return;
}
binmode(STDOUT);
# display them later on the page (using JavaScript).
use CGI::WebGzip;
BEGIN {
CGI::WebGzip::setCallback(sub {
my ($nL, $oL) = (length $_[0], length $_[2]);
print sprintf "Set-Cookie: page_size=%d,%d; path=/\n", $oL, $nL;
return 1;
});
}
view all matches for this distribution
view release on metacpan or search on metacpan
our @EXPORT=qw(
%IN
%GET
%POST
%COOKIES
SetCookie
DropCookie
);
####################### Êîíñòàíòû, óïðàâëÿþùèå ðàáîòîé #####################
our $CANUPL_FILE = ".can_upload"; # èìÿ ôàéëà, ðàçðåøàþùåãî çàêà÷êó
####################### Ïðåðåìåííûå ñ äàííûìè áðàóçåðà #####################
our %IN = (); # Äàííûå ôîðìû
our %GET = (); # Äàííûå GET
our %POST = (); # Äàííûå POST
our %COOKIES = (); # Âñå ïðèøåäøèå Cookies
our %IMPORT_MOD = (); # Ìîäóëè, çàòðåáîâàâøèå èìïîðò ïåðåìåííûõ (êëþ÷è)
# void _reparseAll()
# Parses all the input data.
read(STDIN,my $data,$ENV{CONTENT_LENGTH});
_parseURLEnc($data,"post");
}
}
if($ENV{HTTP_COOKIE} || $ENV{COOKIE}) {
_parseCookies();
}
# use Data::Dumper; print "<pre>".Dumper(\%IN)."</pre>";
}
} else {
# Âûçîâ ñ ïàðàìåòðàìè - ýêñïîðò ïåðåìåííûõ òîëüêî â óêàêçàííûé ìîäóëü
return if !$opt;
$opt="gpces" if lc($opt) eq "a" || $opt eq "1";
# Ñîõðàíÿåì èíôîðìàöèþ î òîì, ÷òî ìîäóëü "õî÷åò" ýêñïîðòèðîâàíèÿ è
# â äàëüíåéøåì. Íàïðèìåð, ïðè âûçîâå SetCookie() ñîîòâåòñòâóþùàÿ
# ïåðåìåííàÿ ñîçäàñòñÿ íå òîëüêî â %COOKIES, íî è âî âñåõ ìîäóëÿõ.
$IMPORT_MOD{$to}=$opt;
# Ýêñïîðòèðóåì åùå íå ñóùåñòâóþùèå ïåðåìåííûå
no strict;
my $Bad=\%{$to."::"};
}
}
END_OF_FUNC
'_parseCookies' => <<'END_OF_FUNC',
# Ðàçáèðàåò ïðèøåäøèå cookies
sub _parseCookies
{ my @Pairs = split("; *",$ENV{HTTP_COOKIE} || $ENV{COOKIE} || "");
foreach (@Pairs) {
my ($key,$value);
if(/^([^=]+)=(.*)/) { $key = $1; $value = $2; } else { $key = $_; $value = ''; }
$key=URLDecode($key);
$WDAY[$wday],$mday,$MON[$mon],$year+1900,$hour,$min,$sec);
}
END_OF_FUNC
'SetCookie' => <<'END_OF_FUNC',
# void SetCookie(string $name, string $value [,int $expire][,$path][,$domain][bool $secure])
# Óñòàíàâëèâàåò cookie ñ èìåíåì $name è çíà÷åíèå $value ($value ìîæåò áûòü ñëîæíûì îáúåêòîì
# - â ÷àñòíîñòè, ññûëêîé íà ìàññèâ èëè õýø).
# Åñëè $value íå çàäàí (undef), cookie óäàëÿåòñÿ.
# Åñëè $expire íå çàäàí, âðåìÿ æèçíè ñòàíîâèòñÿ áåñêîíå÷íûì. Åñëè çàäàí, íî ðàâåí
# íóëþ - ñîçäàåòñÿ one-session cookie.
# Ïàðàìåòð $expire ìîæíî çàäàâàòü â âèäå, êîòîðûé "ïîíèìàåò" ôóíêöèÿ ExpireCalc().
sub SetCookie
{ my ($name,$value,$expires,$path,$domain,$secure)=@_;
my $NeedDel=0;
# [12.03.2002] Ìîæíî è áåç ýòîãî.
# if(!defined $path) {
push(@Param,"domain=$domain") if defined $domain;
push(@Param,"path=$path") if defined $path;
push(@Param,"expires=".Expires($expires,"cookie")) if $expires;
push(@Param,'secure') if $secure;
my $cook="Set-Cookie: ".join("; ",@Param);
eval {
local ($SIG{__WARN__},$SIG{__DIE__})=(sub {}, sub {});
require CGI::WebOut;
};
if($@) {
} else {
CGI::WebOut::Header($cook);
}
if(!$NeedDel) { _processPar($name,$value,"cookie"); }
else { _processPar($name,undef,"cookie"); }
# Ýêñïîðòèðóåì Cookie âî âñå íóæíûå ìîäóëè
export_vars();
}
END_OF_FUNC
'DropCookie' => <<'END_OF_FUNC',
# void DropCookie(string $name [,$path] [,$domain])
# Óäàëÿåò cookie ñ èìåíåì $name. Ïàðàìåòðû $path è $domain
# äîëæíû òî÷íî ñîâïàäàòü ñ òåìè, êîòîðûå áûëè çàäàíû ïðè
# óñòàíîâêå Cookie.
sub DropCookie
{ my ($name,$path,$domain)=@_;
SetCookie($name,undef,undef,$path,$domain);
}
END_OF_FUNC
'Serialize' => <<'END_OF_FUNC',
# just to avoid "typo warning"
our ($doGo,%Address,$Count);
# count visits
SetCookie("Count",++$Count,"+10y");
# is the button pressed?
if($doGo) {
print "Hello from $Address{Russia}{Moscow}!";
}
The main idea is to handle input stream (C<STDIN>) and C<QUERY_STRING>
environment variable sent by browser and parse their correctly
(including multipart forms). Resulting variables are put to C<%GET>,
C<%POST>, C<%COOKIES> and C<%IN> (C<%IN> holds ALL the data). Also
allows you to get/set cookies (any structure, not only scalars!) with
C<SetCookie()> subroutine.
If this module is included without any arguments:
use CGI::WebIn;
it exports the following: C<%IN>, C<%GET>, C<%POST>, C<%COOKIES>,
C<SetCookie()> and C<DropCookie()>
You can specify additional information to be exported by using
include arguments:
use CGI::WebIn 'gpce';
means that all the GET, POST, Cookies and then environment
variables will be exported to "usual" package variables.
You must not be afraid to write everywhere C<'gpce'> - the
following instruction does the same:
use CGI::WebIn 'gpce';
(like PHP does).
=item C<%IN, %GET, %POST and %COOKIES>
C<%IN> contains all the form data. C<%GET>, C<%POST> and C<%COOKIES>
holds GET, POST and Cookies variables respectively.
=item C<void SetCookie($name, $value [,int $expire][,$path][,$domain][bool $secure])>
Sets the cookie in user browser. Value of that cookie is placed to C<%COOKIES>
and ALL exported client modules immediately. Format for time C<$expire> can be
in any of the forms:
"+1d" - in 1 day
"+3M" - in 3 months
"+2y" - in 2 years
"-3m" - 3 minutes ago(!)
=item C<void DropCookie(string $name [,string $path] [,string $domain])>
Destroys the specified cookie. Make sure the C<$path> and C<$domain> parameters are
the same to previous C<SetCookie()> call.
=item C<list of string CGI::WebIn::GetErrors()>
While parsing the form input data errors may appear. For example, these
QUERY_STRINGs are invalid:
view all matches for this distribution
view release on metacpan or search on metacpan
# Do not call Flush() here, because it is incompatible with CGI::Session.
# E.g. the following code will not work if Flush() is uncommented:
# use CGI::WebOut;
# use CGI::Session;
# my $session = new CGI::Session(...);
# SetCookie(...); # says that "headers are already sent"
#CGI::WebOut::Flush();
$this->parentCall(sub { return fileno(*{$this->{handle}}) });
return 0;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Wiki/Kwiki.pm view on Meta::CPAN
template_path => './templates',
stylesheet_url => "",
home_node => 'HomePage',
cgi_path => CGI::url(),
search_map => './search_map',
prefs_expire => '+1M', # passed to CGI::Cookie; see its docs
charset => 'iso-8859-1', # characterset for the wiki
);
The C<db_type> parameter refers to a CGI::Wiki::Store::[type] class.
Valid values are 'MySQL', SQLite', etc: see the L<CGI::Wiki> man page
lib/CGI/Wiki/Kwiki.pm view on Meta::CPAN
=cut
use strict;
use warnings;
use CGI;
use CGI::Cookie;
use CGI::Wiki;
use CGI::Wiki::Search::DB;
use CGI::Wiki::Plugin::Diff;
use Template;
use Algorithm::Merge qw(merge);
lib/CGI/Wiki/Kwiki.pm view on Meta::CPAN
);
}
sub get_prefs_from_cookie {
my $self = shift;
my %cookies = CGI::Cookie->fetch;
my $cookie_name = $self->prefs_cookie_name;
my %data;
if ( $cookies{$cookie_name} ) {
%data = $cookies{$cookie_name}->value; # call ->value in list context
}
lib/CGI/Wiki/Kwiki.pm view on Meta::CPAN
}
sub make_prefs_cookie {
my ($self, %args) = @_;
my $cookie_name = $self->prefs_cookie_name;
my $cookie = CGI::Cookie->new(
-name => $cookie_name,
-value => {
username => $args{username},
},
-expires => $self->prefs_expire,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/apacheSSI.pm view on Meta::CPAN
# PROPER VIRTUAL CALLS TO CGI SCRIPTS AND mod_rewrite URLS
use File::Spec::Functions; # catfile()
use HTTP::Response;
use HTTP::Cookies;
use Date::Format;
use Cwd;
our $VERSION = '0.96';
lib/CGI/apacheSSI.pm view on Meta::CPAN
$self->{'_variables'}->{LAST_MODIFIED} = $lmod; # needs to be specified after the above, since it requires DOCUMENT_ROOT to be populated
$self->{_max_recursions} = $args{MAX_RECURSIONS} || 100; # no "infinite" loops
$self->{_recursions} = {};
$self->{_cookie_jar} = $args{COOKIE_JAR} || HTTP::Cookies->new();
$self->{'_in_if'} = 0;
$self->{'_suspend'} = [0];
$self->{'_seen_true'} = [1];
lib/CGI/apacheSSI.pm view on Meta::CPAN
DOCUMENT_ROOT => $doc_root,
errmsg => $oops,
sizefmt => ('bytes' || 'abbrev'),
timefmt => $time_fmt,
MAX_RECURSIONS => $default_100, # when to stop infinite loops w/ error msg
COOKIE_JAR => HTTP::Cookies->new,
_verbose_errors => 0 || 1,
=item C<_verbose_errors>
The C<_verbose_errors> option was introduced to enable the output of more verbose
lib/CGI/apacheSSI.pm view on Meta::CPAN
Returns the environment similar to Apache's mod_include.
=item $ssi->cookie_jar([$jar])
Returns the currently-used HTTP::Cookies object. You may optionally
pass in a new HTTP::Cookies object. The jar is used for web requests
in exec cgi and include virtual directives.
=back
=head2 FLOW-CONTROL METHODS
view all matches for this distribution
view release on metacpan or search on metacpan
kSession.pm view on Meta::CPAN
path - the directory where you want to store your session files
id - if you want to give the session a non-random name, use this parameter as well
=item $s->start();
This creates a session or resumes an old one (could be used in conjunction with something like HTTP::Cookie). This will return '1' if this is a new session, and '0' if it's resuming an old one. If you defined no values in the 'new()' call, then the s...
=item $s->save_path();
Save the session path or, without an argument, return the current session path. Used with an argument, this performs the same thing as the 'path' parameter in the constructor.
kSession.pm view on Meta::CPAN
$s->unset(); # unregister all variables
$s->destroy(); # delete session with this ID
I<Marcin Krzyzanowski>
=item Sessions, URLs, and Cookies
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use CGI::kSession;
use CGI::Cookie;
my $cgi = new CGI;
my $last_sid = $cgi->param("SID");
my $c = new CGI::Cookie(-name=>'SID',-value=>$last_sid);
my ($id, $key, $value);
my $s = new CGI::kSession(path=>"/tmp/");
print $cgi->header(-cookie=>$c);
print $cgi->start_html();
if ($last_sid) {
# note: the following I used for mozilla - your mileage may vary
my $cookie_sid = (split/[=;]/, (fetch CGI::Cookie)->{SID})[1];
if ($cookie_sid) {
print "<b>We are now reading from the cookie:</b><p>";
$id = $s->id($cookie_sid);
$s->start($cookie_sid);
view all matches for this distribution
view release on metacpan or search on metacpan
Session/CVS/Base/LDAPSession.pm view on Meta::CPAN
'ou=my,ou=domain', # root
'ou=people,ou=my,ou=domain' # base
'uid=$username,ou=people,ou=my,ou=domain' # bind
) ] );
$session->cookie_table( 'myCookieTable' );
=head2 Performing the Initial Login
my $action = $cgi->param('action');
my $passkey = $cgi->param('passkey');
Session/CVS/Base/LDAPSession.pm view on Meta::CPAN
$session->user_column('username');
$session->cookie_column('login_cookie');
$session->passkey_column('login_passkey');
=head2 Setting Cookie Parameters
When your program sends back a cookie, the cookie needs to have several
parameters set. These include the name of the cookie, the path which it
covers, the domain for which it is good, and wether or not it should
be used without a secure connection.
$session->cookie_name( 'MySessionCookie123587098' ); # The name of the cookie
$session->cookie_path( '/' );
$session->cookie_domain( '.drinktomi.com' );
$session->secure( 1 ); # 1=requires secure transport
# 0=does not require secure transport
Session/CVS/Base/LDAPSession.pm view on Meta::CPAN
for. This is the expiration. It is given in seconds. If using the
refresh option (more on this later) then the expiration determines how
long the web browser can sit idle. If not using the refresh option
then it determines how long the user will remain logged in.
$session->cookie_expiration( 60*60*2 ); # Cookies will be good for two hours.
=head2 Setting Login Behavior
Setting the auto refresh cookie option to 1 will the cookie's expiration
time to be updated every time a page is sent to the client. As long as
Session/CVS/Base/LDAPSession.pm view on Meta::CPAN
...
Session was confirmed and this is a valid session
...
}
=head2 Changing the Cookie Identifier
if ( $session->confirmed( $key ) )
{
$session->set_login_cookie;
...
Session was confirmed and this is a valid session
...
}
=head2 Refreshing the Cookie Expiration
if ( $session->confirmed( $key ) )
{
$session->refresh_login_cookie;
...
Session/CVS/Base/LDAPSession.pm view on Meta::CPAN
print $cgi->end_html;
exit 0;
}
=head2 Creating the Cookie Table
Guess what? Once you have configured your CGIviaLDAP there is a function
which will create the table that you have described. It only works for
MySQL at the moment, but in the future it may work for other databases.
Session/CVS/Base/LDAPSession.pm view on Meta::CPAN
$self->passkey_name( $a{-passkey_name} ) if defined $a{-passkey_name};
$self->debug( $a{-debug} ) if defined $a{-debug};
}
# Cookie characteristics.
#
=item Cookie Characteristics
These accessor methods specify the details of the cookies which are generated.
=item CGI::LDAPSession::cookie_logged_in($;$)
Session/CVS/Base/LDAPSession.pm view on Meta::CPAN
$client_cookie = $self->check_cookie;
if(!defined $client_cookie or !$client_cookie)
{
# No client Cookie!
carp "No Cookie!" if $self->debug;
$self->is_authenticated(undef);
return 0;
}
my $cookie_table = $self->cookie_table;
Session/CVS/Base/LDAPSession.pm view on Meta::CPAN
-expires=>$datetimestr );
return $cookie;
}
#
# Set the Session Cookie (login)
#
=item CGI::LDAPSession::set_login_cookie($;$)
Sets the login cookie for an authenticated session. If a username
is not specified then it pulls the username corresponding to the
Session/CVS/Base/LDAPSession.pm view on Meta::CPAN
# SUCCESS
return 0;
}
#
# Check Cookie
#
=item CGI::LDAPSession::check_cookie($)
Returns the cookie for this session if it exists. If a
cookie does not exist then it returns nothing.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CLI/Dispatch/Help.pm view on Meta::CPAN
package MyScript::Help;
use strict;
use base qw( CLI::Dispatcher::Help );
sub extra_namespaces { qw( MyScript::Cookbook ) }
1;
then, when you run the script like this, MyScript/Cookbook/Install.pod (or .pm)
will be shown:
> perl myscript.pl help install
You may even make it language-conscious:
lib/CLI/Dispatch/Help.pm view on Meta::CPAN
sub extra_namespaces {
my $self = shift;
my $lang = uc( $self->option('lang') || 'EN' );
return (
'MyScript::Cookbook::'.$lang,
'MyScript::Cookbook::EN', # in case of $lang is wrong
);
1;
This can be used to provide more user-friendly documents (without overriding
commands themselves).
view all matches for this distribution
view release on metacpan or search on metacpan
Debian_CPANTS.txt view on Meta::CPAN
"libapache-htgroup-perl", "Apache-Htgroup", "1.23", "1", "0"
"libapache-session-perl", "Apache-Session", "1.89", "0", "1"
"libapache-session-wrapper-perl", "Apache-Session-Wrapper", "0.34", "0", "0"
"libapache-sessionx-perl", "Apache-SessionX", "2.01", "2", "2"
"libapache2-authcassimple-perl", "Apache2-AuthCASSimple", "0.10", "1", "0"
"libapache2-authcookie-perl", "Apache-AuthCookie", "3.18", "0", "1"
"libapache2-authenntlm-perl", "Apache2-AuthenNTLM", "0.02", "0", "0"
"libapache2-mod-perl2", "http://perl.apache.org/dist/mod_perl-2.0.5.tar.gz", "2.0.5", "11", "11"
"libapache2-reload-perl", "Apache-Reload", "0.11", "1", "1"
"libapp-cli-perl", "App-CLI", "0.313", "0", "2"
"libapp-cmd-perl", "App-Cmd", "0.311", "0", "0"
Debian_CPANTS.txt view on Meta::CPAN
"libcgi-application-plugin-anytemplate-perl", "CGI-Application-Plugin-AnyTemplate", "0.18", "0", "1"
"libcgi-application-plugin-authentication-perl", "CGI-Application-Plugin-Authentication", "0.20", "0", "0"
"libcgi-application-plugin-authorization-perl", "CGI-Application-Plugin-Authorization", "0.07", "0", "1"
"libcgi-application-plugin-tt-perl", "CGI-Application-Plugin-TT", "1.05", "0", "1"
"libcgi-application-server-perl", "CGI-Application-Server", "0.062", "0", "0"
"libcgi-cookie-splitter-perl", "CGI-Cookie-Splitter", "0.02", "1", "0"
"libcgi-formalware-perl", "CGI-Formalware", "1.13", "0", "0"
"libcgi-formbuilder-source-yaml-perl", "CGI-FormBuilder-Source-YAML", "1.0.8", "0", "0"
"libcgi-minimal-perl", "CGI-Minimal", "not-uploaded", "0", "1"
"libcgi-pm-perl", "CGI", "3.53", "0", "2"
"libcgi-session-driver-memcached-perl", "CGI-Session-Driver-memcached", "0.04", "0", "0"
Debian_CPANTS.txt view on Meta::CPAN
"libhtml-wikiconverter-wakkawiki-perl", "HTML-WikiConverter-WakkaWiki", "0.50", "0", "0"
"libhtml-wikiconverter-wikkawiki-perl", "HTML-WikiConverter-WikkaWiki", "0.50", "0", "0"
"libhttp-async-perl", "HTTP-Async", "0.09", "0", "1"
"libhttp-body-perl", "HTTP-Body", "1.11", "0", "0"
"libhttp-browserdetect-perl", "HTTP-BrowserDetect", "1.24", "0", "0"
"libhttp-cookies-perl", "HTTP-Cookies", "6.00", "1", "0"
"libhttp-daemon-perl", "HTTP-Daemon", "6.00", "1", "0"
"libhttp-date-perl", "HTTP-Date", "6.00", "0", "0"
"libhttp-exception-perl", "HTTP-Exception", "0.03001", "0", "0"
"libhttp-lite-perl", "HTTP-Lite", "2.3", "0", "0"
"libhttp-message-perl", "HTTP-Message", "6.01", "2", "0"
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CMS/Drupal/Modules/MembershipEntity/Cookbook.pm view on Meta::CPAN
package CMS::Drupal::Modules::MembershipEntity::Cookbook;
$CMS::Drupal::Modules::MembershipEntity::Cookbook::VERSION = '0.96';
# ABSTRACT: Guide and tutorials for using the Perl-Drupal Membership Entity interface
use strict;
use warnings;
lib/CMS/Drupal/Modules/MembershipEntity/Cookbook.pm view on Meta::CPAN
=encoding UTF-8
=head1 NAME
CMS::Drupal::Modules::MembershipEntity::Cookbook - Guide and tutorials for using the Perl-Drupal Membership Entity interface
=head1 VERSION
version 0.96
view all matches for this distribution
view release on metacpan or search on metacpan
MICO/mapping.pod view on Meta::CPAN
id_assignment => 'MULTIPLE_ID',
lifetime => 'PERSISTENT');
=head2 Mapping for ServantManager
The opaque Cookie type maps to an arbitary Perl value.
=back
=head1 AUTHOR
view all matches for this distribution
view release on metacpan or search on metacpan
ORBit/mapping.pod view on Meta::CPAN
id_assignment => 'MULTIPLE_ID',
lifetime => 'PERSISTENT');
=head2 Mapping for ServantManager
The opaque Cookie type maps to an arbitary Perl value.
=back
=head1 AUTHOR
view all matches for this distribution
view release on metacpan or search on metacpan
omniORB/mapping.pod view on Meta::CPAN
id_assignment => 'MULTIPLE_ID',
lifetime => 'PERSISTENT');
=head2 Mapping for ServantManager
The opaque Cookie type maps to an arbitary Perl value.
=back
=head1 AUTHOR
view all matches for this distribution
view release on metacpan or search on metacpan
0.14 2019-01-26T10:23:21Z
[ADVISORIES]
CPANSA-Dancer2
CPANSA-HTTP-Session2
CPANSA-Plack-Middleware-Session-Cookie
0.13 2018-11-22T20:38:09Z
- --no-corelist option by MCRayRay
- test fixes
view all matches for this distribution
view release on metacpan or search on metacpan
corpus/dists/DBIx-Class.changes view on Meta::CPAN
- Fix nasty schema/dbhandle leak due to SQL::Translator
- Initial implementation of a mechanism for Schema::Version to
apply multiple step upgrades
- Fix regression on externally supplied $dbh with AutoCommit=0
- FAQ "Custom methods in Result classes"
- Cookbook POD fix for add_drop_table instead of add_drop_tables
- Schema POD improvement for dclone
0.08115 2009-12-10 09:02:00 (CST)
- Real limit/offset support for MSSQL server (via Row_Number)
- Fix distinct => 1 with non-selecting order_by (the columns
corpus/dists/DBIx-Class.changes view on Meta::CPAN
- Fix problems with scalarrefs under InflateColumn (RT#51559)
- Throw exception on delete/update of PK-less resultsets
- Refactored Sybase storage driver into a central ::DBI::Sybase
dispatcher, and a sybase-specific ::DBI::Sybase::ASE
- Fixed an atrocious DBD::ADO bind-value bug
- Cookbook/Intro POD improvements
0.08114 2009-11-14 17:45:00 (UTC)
- Preliminary support for MSSQL via DBD::ADO
- Fix botched 0.08113 release (invalid tarball)
corpus/dists/DBIx-Class.changes view on Meta::CPAN
- Calling the accessor of a belongs_to when the foreign_key
was NULL and the row was not stored would unexpectedly fail
- Split sql statements for deploy only if SQLT::Producer returned a scalar
containing all statements to be executed
- Add as_query() for ResultSet and ResultSetColumn. This makes subqueries
possible. See the Cookbook for details.
- Massive rewrite of Ordered to properly handle position constraints and
to make it more matpath-friendly
- deploy_statements called ddl_filename with the $version and $dir arguments
in the wrong order.
- columns/+columns attributes now support { as => select } hahsrefs
view all matches for this distribution
view release on metacpan or search on metacpan
eg/report.html view on Meta::CPAN
<td><a href="http://search.cpan.org/dist/Task-SOSA"
title="Read the documentation of this distribution on Search CPAN"
>Task-SOSA</a> [<a href="http://cpan.uwinnipeg.ca/dist/Task-SOSA"
title="Read the documentation of this distribution on Kobesearch"
>mirror</a>]
<div class="popup prereqs"><div><strong>Prerequisites:</strong> Catalyst-Model-LDAP, Catalyst-Plugin-Authentication, Catalyst-Plugin-Authentication-Store-LDAP, Catalyst-Plugin-Authorization-ACL, Catalyst-Plugin-Authorization-Roles, Catalyst-Plu...
</td>
<td>31</td>
</tr>
<tr>
<td><a href="http://search.cpan.org/dist/Buscador"
view all matches for this distribution
view release on metacpan or search on metacpan
cpanfile.snapshot view on Meta::CPAN
provides:
Module::Build 0.4214
Module::Build::Base 0.4214
Module::Build::Compat 0.4214
Module::Build::Config 0.4214
Module::Build::Cookbook 0.4214
Module::Build::Dumper 0.4214
Module::Build::Notes 0.4214
Module::Build::PPMMaker 0.4214
Module::Build::Platform::Default 0.4214
Module::Build::Platform::MacOS 0.4214
view all matches for this distribution
view release on metacpan or search on metacpan
t/cache/CPAN-FindDependencies-1.1-no_index-twice/Module-Build-0.2808.meta view on Meta::CPAN
Module::Build::Compat:
file: lib/Module/Build/Compat.pm
version: 0.03
Module::Build::Config:
file: lib/Module/Build/Config.pm
Module::Build::Cookbook:
file: lib/Module/Build/Cookbook.pm
Module::Build::ModuleInfo:
file: lib/Module/Build/ModuleInfo.pm
Module::Build::Notes:
file: lib/Module/Build/Notes.pm
Module::Build::PPMMaker:
view all matches for this distribution
view release on metacpan or search on metacpan
t/unpacked/GraphViz/examples/recdescent.pl view on Meta::CPAN
use GraphViz::Parse::RecDescent;
# The grammar below was taken from the Parse::RecDescent
# demo_recipe.pl script
# "Potato, Egg, Red meat & Lard Cookbook",
# T. Omnicient Rash & N. Hot Ignorant-Kant
# O'Besity & Associates
my $recipegrammar =
q{
view all matches for this distribution
view release on metacpan or search on metacpan
t/data-fail/META-1_4.yml view on Meta::CPAN
file: lib/Module/Build/Compat.pm
version: 0.36_08
Module::Build::Config:
file: lib/Module/Build/Config.pm
version: 0.36_08
Module::Build::Cookbook:
file: lib/Module/Build/Cookbook.pm
version: 0.36_08
Module::Build::Dumper:
file: lib/Module/Build/Dumper.pm
version: 0.36_08
Module::Build::ModuleInfo:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CPAN/Plugin/Sysdeps.pm view on Meta::CPAN
L<https://www.procura.nl/> Procura,
L<https://constructor.io/> Constructor.io,
L<https://metacpan.org/author/BABF> Robbie Bow,
L<https://metacpan.org/author/RSAVAGE> Ron Savage,
L<https://metacpan.org/author/ITCHARLIE> Charlie Gonzalez,
L<https://twitter.com/jscook2345> Justin Cook.
=head1 CONTRIBUTORS
Max Maischein (CORION) - Windows/chocolatey support
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/TestSQL.pm view on Meta::CPAN
'modules' => {
'LWP::Dump' => 1,
'LWP::Conn::HTTP' => 1,
'LWP::Authen::digest' => 1,
'LWP::Sink::Tee' => 1,
'LWP::UA::Cookies' => 1,
'LWP::MainLoop' => 1,
'LWP::Sink::rot13' => 1,
'LWP::Sink::identity' => 1,
'LWP::StdSched' => 1,
'LWP::Version' => 1,
t/lib/TestSQL.pm view on Meta::CPAN
'LWP::Protocol::cpan' => 1,
'LWP::Protocol::ftp' => 1,
'HTTP::Status' => 1,
'File::Listing' => 1,
'LWP::Protocol::http10' => 1,
'HTTP::Cookies::Microsoft' => 1,
'HTTP::Headers' => 1,
'LWP::Protocol::nogo' => 1,
'LWP::Protocol::nntp' => 1,
'HTTP::Daemon' => 1,
'LWP::Protocol::mailto' => 1,
'HTML::Form' => 1,
'LWP::Protocol::gopher' => 1,
'LWP::ConnCache' => 1,
'Net::HTTPS' => 1,
'HTTP::Cookies' => 1,
'HTTP::Message' => 1,
'HTTP::Request::Common' => 1,
'HTTP::Headers::Auth' => 1,
'LWP::Protocol::loopback' => 1,
'HTTP::Response' => 1,
'HTTP::Cookies::Netscape' => 1,
'LWP::Authen::Ntlm' => 1,
'LWP::Authen::Basic' => 1,
'WWW::RobotRules' => 1,
'LWP::Protocol' => 1,
'HTTP::Request' => 1,
t/lib/TestSQL.pm view on Meta::CPAN
'dist_file' => 'Data-Dump-1.06.tar.gz'
},
'CGI' => {
'modules' => {
'CGI::Fast' => 1,
'CGI::Cookie' => 1,
'CGI::Util' => 1,
'CGI::Pretty' => 1,
'CGI::Push' => 1,
'CGI' => 1,
'CGI::Carp' => 1
t/lib/TestSQL.pm view on Meta::CPAN
},
'Authen::SASL' => {
'dist_name' => 'Authen-SASL',
'mod_vers' => '2.10'
},
'LWP::UA::Cookies' => {
'dist_name' => 'LWPng-alpha',
'mod_vers' => undef
},
'GD::Simple' => {
'dist_name' => 'GD',
t/lib/TestSQL.pm view on Meta::CPAN
},
'LWP::Protocol::http10' => {
'dist_name' => 'libwww-perl',
'mod_vers' => undef
},
'HTTP::Cookies::Microsoft' => {
'dist_name' => 'libwww-perl',
'mod_vers' => '1.07'
},
'Apache::HeavyCGI::Exception' => {
'dist_name' => 'Apache-HeavyCGI',
t/lib/TestSQL.pm view on Meta::CPAN
},
'Tie::MAB2::Recno' => {
'dist_name' => 'MAB2',
'mod_vers' => '1.006'
},
'CGI::Cookie' => {
'dist_name' => 'CGI',
'mod_vers' => '1.27'
},
'Ace::Graphics::Glyph::span' => {
'dist_name' => 'AcePerl',
t/lib/TestSQL.pm view on Meta::CPAN
},
'URI::_server' => {
'dist_name' => 'URI',
'mod_vers' => undef
},
'HTTP::Cookies' => {
'dist_name' => 'libwww-perl',
'mod_vers' => '1.39'
},
'HTTP::Request::Common' => {
'dist_name' => 'libwww-perl',
t/lib/TestSQL.pm view on Meta::CPAN
},
'LWP::Conn::FTP' => {
'dist_name' => 'LWPng-alpha',
'mod_vers' => undef
},
'HTTP::Cookies::Netscape' => {
'dist_name' => 'libwww-perl',
'mod_vers' => '1.26'
},
'Bio::Das::Type' => {
'dist_name' => 'Bio-Das',
view all matches for this distribution
view release on metacpan or search on metacpan
* release 2.37-TRIAL
* This release is dedicated to Abe Timmerman
* don't use an apostrophe in names (Tony Cook)
* docs: new FAQ about recommends and suggests
* docs: improve the answer to FAQ "when an install fails..."
* introduce new config variable cleanup_after_install: helps
keeping build directory small (Andreas Koenig)
* adopting changes from bleadperl related to removal of "." from
@INC (Tony Cook)
* distroprefs minor updates
2016-07-17 k <andk@cpan.org>
view all matches for this distribution