view release on metacpan or search on metacpan
lib/CGI/Inspect/htdocs/js/jquery.cookie.js view on Meta::CPAN
/**
* Cookie plugin
*
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
lib/CGI/Inspect/htdocs/js/jquery.cookie.js view on Meta::CPAN
* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
* require a secure protocol (like HTTPS).
* @type undefined
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/
/**
* Get the value of a cookie with the given name.
lib/CGI/Inspect/htdocs/js/jquery.cookie.js view on Meta::CPAN
* @param String name The name of the cookie.
* @return The value of the cookie.
* @type String
*
* @name $.cookie
* @cat Plugins/Cookie
* @author Klaus Hartl/klaus.hartl@stilbuero.de
*/
jQuery.cookie = function(name, value, options) {
if (typeof value != 'undefined') { // name and value given, set cookie
options = options || {};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Apache2/JSONRPC.pm view on Meta::CPAN
use base qw(CGI::JSONRPC::Base Apache2::Module);
our $VERSION = "0.02";
__PACKAGE__->add([ CookOptions(
[
'JSONRPC_Class',
'Perl class to dispatch JSONRPC calls to.',
],
)]);
return 1;
sub CookOptions { return(map { CookOption(@$_) } @_); }
sub CookOption {
my($option, $help) = @_;
return +{
name => $option,
func => join('::', __PACKAGE__, 'SetOption'),
args_how => TAKE1,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Kwiki.pm view on Meta::CPAN
set of lines like this:
config_class: CGI::Kwiki::Config
driver_class: CGI::Kwiki::Driver
cgi_class: CGI::Kwiki::CGI
cookie_class: CGI::Kwiki::Cookie
database_class: CGI::Kwiki::Database
metadata_class: CGI::Kwiki::Metadata
display_class: CGI::Kwiki::Display
edit_class: CGI::Kwiki::Edit
formatter_class: CGI::Kwiki::Formatter
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Lazy/ModPerl.pm view on Meta::CPAN
session => {
sessionTable => 'SessionData',
sessionCookie => 'frobnostication',
saveOnDestroy => 1,
expires => '+15m',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Lazy.pm view on Meta::CPAN
my $lazycookie;
if ($self->plugin) { #it's possible that this object hasn't been built- if the config object doesn't create for instance.
if ($self->plugin->session && $self->session) {
$lazycookie = $self->cookie(
-name => $self->plugin->session->{sessionCookie},
-expires => $self->plugin->session->{expires},
-value => $self->session->sessionID,
);
}
} else { #something really bad happened. Return a header anyway, so we can show an error message
lib/CGI/Lazy.pm view on Meta::CPAN
session => {
sessionTable => 'SessionData',
sessionCookie => 'frobnostication',
saveOnDestroy => 1,
expires => '+15m',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Lite/Request.pm view on Meta::CPAN
combines the response headers and sends these to the user agent
=item cookie
returnes a named L<CGI::Lite::Cookie> object. If one doesn't
exist by the passed name, then creates a new one and returns
it. Typical semantics would be:
$sessid = $req->cookie('SID')->value;
$req->cookie('SID')->value($sessid);
both of these methods will create a new L<CGI::Lite::Request::Cookie>
object if one named 'SID' doesn't already exist. If you don't
want this behaviour, see C<cookies> method
=item cookies
returns a hash reference of L<CGI::Lite::Request::Cookie> objects keyed on their names.
This can be used for accessing cookies where you don't want them
to be created automatically if they don't exists, or for simply
checking for their existence:
if (exists $req->cookies->{'SID'}) {
$sessid = $req->cookies->{'SID'}->value;
}
see L<CGI::Lite::Request::Cookie> for more details
=item upload
returns a named L<CGI::Lite::Upload> object keyed on the field name
with which it was associated when uploaded.
lib/CGI/Lite/Request.pm view on Meta::CPAN
Thanks to Sebastian Riedel for the code shamelessly stolen
from L<Catalyst::Request> and L<Catalyst::Request::Upload>
=head1 SEE ALSO
L<CGI::Lite>, L<CGI::Lite::Cookie>, L<CGI::Lite::Upload>
=head1 LICENCE
This library is free software and may be used under the same terms as Perl itself
view all matches for this distribution
view release on metacpan or search on metacpan
34827 and 41666).
BUG FIX: Leading/trailling whitespace is now stripped from cookie names
and values.
BUG FIX: Cookies now no longer need to be separated by whitespace.
Commas can now be used as separators too. (issue 32329).
BUG FIX: The semicolon is now a permitted delimiter in the query string
along with the ampersand (issue 8212).
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Minimal.pod view on Meta::CPAN
=item date_rfc1123($time);
Takes a unix time tick value and returns a RFC1123 compliant date
as a formatted text string suitable for direct use in Expires,
Last-Modified or other HTTP headers (with the exception of
'Set-Cookie', which requires a different format not generated
here. See 'CGI::Cookie' for cookie generation).
Example:
print "Expires: ",$cgi->date_rfc1123(time + 3600),"\015\012";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/MultiValuedHash.pm view on Meta::CPAN
Some query strings are the result of ISINDEX queries, and they look different:
tell&me&about&stuff
Cookie strings such as $ENV{HTTP_COOKIE} are different yet and look like:
name=color; type=popup_menu; values=red&green&blue&chartreuse
In the argument lists for the above methods, DELIM refers to the "&" in normal
query strings and the "; " in cookies, whereas VALSEP is meaningless with normal
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Mungo/Session.pm view on Meta::CPAN
use strict;
use warnings;
use Digest::MD5;
use Data::Dumper;
use CGI::Thin::Cookies;
use File::Spec;
use base qw(CGI::Mungo::Base CGI::Mungo::Log);
our $prefix = "MG";
our $path = "/tmp";
##############################################################################################################################
lib/CGI/Mungo/Session.pm view on Meta::CPAN
Creates a new session for the visitor.
This saves the contents of the given hash reference into the session.
The correct Set-Cookie header will be issued through the provided L<CGI::Mungo::Response> object.
=cut
##############################################################################################################
sub create{ #creates a server-side cookie for the session
lib/CGI/Mungo/Session.pm view on Meta::CPAN
$self->setVar($name, $value);
}
if(!$self->getError()){ #all ok so far
my $domain = $ENV{'HTTP_HOST'}; #use the full domain name here
if($response){
my $cookie = &Set_Cookie(NAME => 'SESSION', VALUE => $sessionId, EXPIRE => 0, DOMAIN => $domain);
if($cookie =~ m/^([^ ]+): (.+)$/){
$response->header($1 => $2);
$result = 1;
}
else{
$self->setError("Invalid cookie line: $cookie");
}
}
else{ #old method if it is still used
print &Set_Cookie(NAME => 'SESSION', VALUE => $sessionId, EXPIRE => 0, DOMAIN => $domain);
$result = 1;
}
}
return $result;
}
##############################################################################################################
sub read{ #read an existing session
my $self = shift;
my $result = 0;
my $sessionId = $self->_getCookie("SESSION"); #get the session id from the browser
if(defined($sessionId)){ #got a sessionid of some sort
my $prefix = $self->_getPrefix();
if($sessionId =~ m/^($prefix[a-f0-9]+)$/){ #filename valid
my $path = $self->_getPath();
my $sessionFile = File::Spec->catfile($path, $1);
lib/CGI/Mungo/Session.pm view on Meta::CPAN
my $path = $self->_getPath();
my $sessionFile = File::Spec->catfile($path, $sessionId);
if(unlink($sessionFile)){
$self->log("Deleted session: $sessionId");
if($response){
my $cookie = &Set_Cookie(NAME => 'SESSION', EXPIRE => 'delete');
if($cookie =~ m/^([^ ]+): (.+)$/){
$response->header($1 => $2);
}
else{
$self->setError("Invalid cookie line: $cookie");
}
}
else{
print &Set_Cookie(NAME => 'SESSION', EXPIRE => 'delete');
}
$self = undef; #destroy this object
$result = 1;
}
else{
lib/CGI/Mungo/Session.pm view on Meta::CPAN
else{$self->setError('Session ID invalid');}
if($self->getError()){return 0;}
else{return 1;}
}
############################################################################################################
sub _getCookie{ #returns the value of a cookie
my $self = shift;
my $name = shift;
my $value = undef;
if(exists($ENV{'HTTP_COOKIE'})){ #we have some kind of cookie
my @pairs = split(/; /, $ENV{'HTTP_COOKIE'}); #this cookie might contain multiple name value pairs
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/PSGI.pm view on Meta::CPAN
# push all the cookies -- there may be several
if ($cookie) {
my(@cookie) = ref($cookie) && ref($cookie) eq 'ARRAY' ? @{$cookie} : $cookie;
for (@cookie) {
my $cs = UNIVERSAL::isa($_,'CGI::Cookie') ? $_->as_string : $_;
push(@header,"Set-Cookie", $cs) if $cs ne '';
}
}
# if the user indicates an expiration time, then we need
# both an Expires and a Date header (so that the browser is
# uses OUR clock)
lib/CGI/PSGI.pm view on Meta::CPAN
'-Location'=> $url,
'-nph' => $nph);
unshift(@o,'-Target'=>$target) if $target;
unshift(@o,'-Type'=>'');
my @unescaped;
unshift(@unescaped,'-Cookie'=>$cookie) if $cookie;
return $self->psgi_header((map {$self->unescapeHTML($_)} @o),@unescaped);
}
# The list is auto generated and modified with:
# perl -nle '/^sub (\w+)/ and $sub=$1; \
view all matches for this distribution
view release on metacpan or search on metacpan
my $new_cookie = CGI::cookie
(-name => $cookie_name,
-value => $cookie_value,
);
if (exists $ENV{CONTENT_TYPED}) {
print qq{<meta http-equiv="Set-Cookie" content="$new_cookie">\n};
} else {
print "Set-Cookie: $new_cookie\n";
}
return;
}
sub set_sid {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Plus.pm view on Meta::CPAN
use strict;
use Carp;
use CGI::Safe 'taint';
use base 'CGI::Safe';
use String::Util ':all';
use CGI::Cookie;
# version
our $VERSION = '0.15';
# Debug::ShowStuff
lib/CGI/Plus.pm view on Meta::CPAN
# output HTTP headers, including added cookies, the CSRF cookie,
# and the new header
print $cgi->header_plus;
# outputs something like this:
# Set-Cookie: newcookie=val2&2&val1&1; path=/
# Set-Cookie: mycookie=y&2&x&2; path=/
# Set-Cookie: csrf=v&KTFnGgpkZ4; path=/
# Date: Sun, 29 Jul 2012 04:08:06 GMT
# Myheader: whatever
# Content-Type: text/json; charset=ISO-8859-1
=head1 INSTALLATION
lib/CGI/Plus.pm view on Meta::CPAN
$cgi->{'cookies'} = {};
$got = $cgi->{'cookies'}->{'incoming'} = {};
$cgi->{'cookies'}->{'outgoing'} = {};
# get hash of cookies that were sent
%cookies = CGI::Cookie->fetch();
# showhash \%cookies, title=>'%cookies';
# populate cookie values
foreach my $name (keys %cookies) {
my ($cookie, $element, @value);
lib/CGI/Plus.pm view on Meta::CPAN
# clone $got cookie
foreach my $key (keys %$got) {
my $value = $got->{$key};
# original cookie
if (UNIVERSAL::isa $value, 'CGI::Cookie') {
$send->{$key} = $value;
}
# hashref
elsif (UNIVERSAL::isa $value, 'HASH') {
lib/CGI/Plus.pm view on Meta::CPAN
else {
$params{'-expires'} = '+1y';
}
# create cookie object
$cookie = CGI::Cookie->new(%params);
if (! defined $cookie) {
# showhash \%params, title=>'error generating cookie';
die 'cookie error';
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Portable.pm view on Meta::CPAN
######################################################################
=head2 get_http_cookies_ref()
This method is an accessor for the "http cookies" array property of this
object, a reference to which it returns. Cookies are used for simple data
persistance on the client side, and are passed back and forth in the HTTP
headers. If this property is defined, then a "Set-Cookie" HTTP header would be
made for each list element. Each array element is treated like a scalar
internally as this class assumes you will encode each cookie prior to insertion.
=head2 get_http_cookies()
view all matches for this distribution
view release on metacpan or search on metacpan
Portal/Sessions.pm view on Meta::CPAN
my $cc = $self->{'rdb'}->exec("select $self->{'conf'}{'session_index_field'} from $self->{'conf'}{'session_table'} order by $self->{'conf'}{'session_index_field'} desc limit 1")->fetch;
my $c = $cc->[0]+1;
# Insert session and prepare cookie
$self->{'rdb'}->exec("insert into $self->{'conf'}{'session_table'} ($self->{'conf'}{'session_index_field'},$self->{'conf'}{'session_sid_field'},$self->{'conf'}{'session_user_field'},$self->{'conf'}{'session_start_field'}) values (" . $self->{'rdb'}...
$self->{'cookies'} .= "Set-Cookie: sid=$sid; path=/\n";
}
# Update session start
sub renew_session {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
use HTML::SimpleParse;
use File::Spec::Functions; # catfile()
use FindBin;
use LWP::UserAgent;
use HTTP::Response;
use HTTP::Cookies;
use URI;
use Date::Format;
our $VERSION = '0.92';
};
$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];
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,
=item $ssi->config($type, $arg)
$type is either 'sizefmt', 'timefmt', or 'errmsg'. $arg is similar to
those of the SSI C<spec>, referenced below.
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
}
###########################################################
sub sessionCookie {
##
## make cookie with session id
##
To access a real user database, you have to use a subclass that modifies the
_login method appropriately. See the modules in the Auth/ subdirectory.
=head2 sessionCookie()
For the session to be persistent across page requests, its session ID has to be
stored in a cookie. This method returns the correct cookie (as generated by CGI::cookie()),
but it remains the duty of the CGI application to send it.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Session/BitBucket.pm view on Meta::CPAN
L<CGI::Session::Tutorial|CGI::Session::Tutorial> - extended CGI::Session manual
=item *
L<CGI::Session::CookBook|CGI::Session::CookBook> - practical solutions for real life problems
=item *
B<RFC 2965> - "HTTP State Management Mechanism" found at ftp://ftp.isi.edu/in-notes/rfc2965.txt
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Session/Driver/bitbucket.pm view on Meta::CPAN
L<CGI::Session::Tutorial|CGI::Session::Tutorial> - extended CGI::Session manual
=item *
L<CGI::Session::CookBook|CGI::Session::CookBook> - practical solutions for real life problems
=item *
B<RFC 2965> - "HTTP State Management Mechanism" found at ftp://ftp.isi.edu/in-notes/rfc2965.txt
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Session/Driver/flexmysql.pm view on Meta::CPAN
L<CGI::Session::Tutorial|CGI::Session::Tutorial> - extended CGI::Session manual
=item *
L<CGI::Session::CookBook|CGI::Session::CookBook> - practical solutions for real life problems
=item *
B<RFC 2965> - "HTTP State Management Mechanism" found at ftp://ftp.isi.edu/in-notes/rfc2965.txt
view all matches for this distribution
view release on metacpan or search on metacpan
example/memc_example.pl view on Meta::CPAN
my $mimeworkaround = 0;
if ($mimeworkaround) {
my ($name, $id, $time_s) = ($sess->name(), $sess->id(), $sess->expire(),);
my $cookie = $cgi->cookie(
-name=>$name, -value=>$id, -expires=> '+' . $time_s . 's',);
print("Set-Cookie: ".$cookie->as_string()."\r\n");
print("Content-type: text/html\r\n\r\n");
}
else {
print $sess->header(); # Override for type: -type => 'text/plain'
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Session/Driver/pure_sql.pm view on Meta::CPAN
L<CGI::Session::Tutorial|CGI::Session::Tutorial> - extended CGI::Session manual
=item *
L<CGI::Session::CookBook|CGI::Session::CookBook> - practical solutions for real life problems
=item *
B<RFC 2965> - "HTTP State Management Mechanism" found at ftp://ftp.isi.edu/in-notes/rfc2965.txt
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Session/Driver/redis.pm view on Meta::CPAN
L<CGI::Session::Tutorial|CGI::Session::Tutorial> - extended CGI::Session manual
=item *
L<CGI::Session::CookBook|CGI::Session::CookBook> - practical solutions for real life problems
=item *
L<Redis|Redis> - Redis interface library.
view all matches for this distribution
view release on metacpan or search on metacpan
L<CGI::Session::Tutorial|CGI::Session::Tutorial> - extended CGI::Session manual
=item *
L<CGI::Session::CookBook|CGI::Session::CookBook> - practical solutions for real life problems
=item *
B<RFC 2965> - "HTTP State Management Mechanism" found at ftp://ftp.isi.edu/in-notes/rfc2965.txt
view all matches for this distribution
view release on metacpan or search on metacpan
MD5_Base32.pm view on Meta::CPAN
L<CGI::Session::Tutorial|CGI::Session::Tutorial> - extended CGI::Session manual
=item *
L<CGI::Session::CookBook|CGI::Session::CookBook> - practical solutions for real life problems
=item *
B<RFC 2965> - "HTTP State Management Mechanism" found at ftp://ftp.isi.edu/in-notes/rfc2965.txt
view all matches for this distribution
view release on metacpan or search on metacpan
MD5_Base64.pm view on Meta::CPAN
L<CGI::Session::Tutorial|CGI::Session::Tutorial> - extended CGI::Session manual
=item *
L<CGI::Session::CookBook|CGI::Session::CookBook> - practical solutions for real life problems
=item *
B<RFC 2965> - "HTTP State Management Mechanism" found at ftp://ftp.isi.edu/in-notes/rfc2965.txt
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Session/MembersArea.pm view on Meta::CPAN
=head1 Description
C<CGI::Session::MembersArea> is a pure Perl module.
It implements an idea from the CGI::Session CookBook, in the section called Member's Area.
It uses a database as a guardian to control access to resources. These resources are
usually other databases, but don't have to be.
When a user supplies their name and password via a CGI form, this module uses 3 items:
view all matches for this distribution
view release on metacpan or search on metacpan
L<CGI::Session::Tutorial|CGI::Session::Tutorial> - extended CGI::Session manual
=item *
L<CGI::Session::CookBook|CGI::Session::CookBook> - practical solutions for real life problems
=item *
C<RFC 2965> - "HTTP State Management Mechanism" found at ftp://ftp.isi.edu/in-notes/rfc2965.txt
view all matches for this distribution
view release on metacpan or search on metacpan
L<CGI::Session::Tutorial|CGI::Session::Tutorial> - extended CGI::Session manual
=item *
L<CGI::Session::CookBook|CGI::Session::CookBook> - practical solutions for real life problems
=item *
B<RFC 2965> - "HTTP State Management Mechanism" found at ftp://ftp.isi.edu/in-notes/rfc2965.txt
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Session.pm view on Meta::CPAN
=head2 header()
A wrapper for C<CGI>'s header() method. Calling this method
is equivalent to something like this:
$cookie = CGI::Cookie->new(-name=>$session->name, -value=>$session->id);
print $cgi->header(-cookie=>$cookie, @_);
You can minimize the above into:
print $session->header();
lib/CGI/Session.pm view on Meta::CPAN
Translation based on 4.14: http://digit.que.ne.jp/work/index.cgi?Perldoc/ja
=item o
Translation based on 3.11, including Cookbook and Tutorial: http://perldoc.jp/docs/modules/CGI-Session-3.11/
=back
=head1 CREDITS
lib/CGI/Session.pm view on Meta::CPAN
We also provide mailing lists for CGI::Session users. To subscribe to the list
or browse the archives visit
https://lists.sourceforge.net/lists/listinfo/cgi-session-user
=item * B<RFC 2109> - The primary spec for cookie handing in use, defining the "Cookie:" and "Set-Cookie:" HTTP headers.
Available at L<http://www.ietf.org/rfc/rfc2109.txt>. A newer spec, RFC 2965 is meant to obsolete it with "Set-Cookie2"
and "Cookie2" headers, but even of 2008, the newer spec is not widely supported. See L<http://www.ietf.org/rfc/rfc2965.txt>
=item *
L<Apache::Session|Apache::Session> - an alternative to CGI::Session.
view all matches for this distribution