Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manwar prc pod document fix #25

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/Plack/Middleware/Session.pm
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ Tatsuhiko Miyagawa

Stevan Little E<lt>stevan.little@iinteractive.comE<gt>

=head1 REPOSITORY
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repository info is already in META info and can be visible on search.cpan and metacpan, I'd avoid repeating that kind of info in multiple places.


L<https://github.com/stevan/plack-middleware-session.git>

=head1 COPYRIGHT AND LICENSE

Copyright 2009, 2010 Infinity Interactive, Inc.
Expand Down
17 changes: 17 additions & 0 deletions lib/Plack/Middleware/Session/Cookie.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package Plack::Middleware::Session::Cookie;
use strict;

our $VERSION = '0.25';
our $AUTHORITY = 'cpan:STEVAN';

use parent qw(Plack::Middleware::Session);

use Plack::Util::Accessor qw(secret session_key domain expires path secure httponly
Expand Down Expand Up @@ -139,9 +143,22 @@ L<Plack::Session::State::Cookie> for these options.

Tatsuhiko Miyagawa

=head1 REPOSITORY

L<https://github.com/stevan/plack-middleware-session.git>

=head1 SEE ALSO

Rack::Session::Cookie L<Dancer::Session::Cookie>

=head1 COPYRIGHT AND LICENSE

Copyright 2009, 2010 Infinity Interactive, Inc.

L<http://www.iinteractive.com>

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut

4 changes: 4 additions & 0 deletions lib/Plack/Session.pm
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ to cpan-RT.

Stevan Little E<lt>stevan.little@iinteractive.comE<gt>

=head1 REPOSITORY

L<https://github.com/stevan/plack-middleware-session.git>

=head1 COPYRIGHT AND LICENSE

Copyright 2009, 2010 Infinity Interactive, Inc.
Expand Down
4 changes: 4 additions & 0 deletions lib/Plack/Session/State.pm
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ to cpan-RT.

Stevan Little E<lt>stevan.little@iinteractive.comE<gt>

=head1 REPOSITORY

L<https://github.com/stevan/plack-middleware-session.git>

=head1 COPYRIGHT AND LICENSE

Copyright 2009, 2010 Infinity Interactive, Inc.
Expand Down
8 changes: 6 additions & 2 deletions lib/Plack/Session/State/Cookie.pm
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ sub finalize {
sub _set_cookie {
my($self, $id, $res, %options) = @_;

my $cookie = bake_cookie(
my $cookie = bake_cookie(
$self->session_key, {
value => $id,
%options,
%options,
}
);
Plack::Util::header_push($res->[1], 'Set-Cookie', $cookie);
Expand Down Expand Up @@ -141,6 +141,10 @@ to cpan-RT.

Stevan Little E<lt>stevan.little@iinteractive.comE<gt>

=head1 REPOSITORY

L<https://github.com/stevan/plack-middleware-session.git>

=head1 COPYRIGHT AND LICENSE

Copyright 2009, 2010 Infinity Interactive, Inc.
Expand Down
4 changes: 4 additions & 0 deletions lib/Plack/Session/Store.pm
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ to cpan-RT.

Stevan Little E<lt>stevan.little@iinteractive.comE<gt>

=head1 REPOSITORY

L<https://github.com/stevan/plack-middleware-session.git>

=head1 COPYRIGHT AND LICENSE

Copyright 2009, 2010 Infinity Interactive, Inc.
Expand Down
13 changes: 13 additions & 0 deletions lib/Plack/Session/Store/Cache.pm
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,17 @@ to cpan-RT.

Masahiro Chiba

=head1 REPOSITORY

L<https://github.com/stevan/plack-middleware-session.git>

=head1 COPYRIGHT AND LICENSE

Copyright 2009, 2010 Infinity Interactive, Inc.

L<http://www.iinteractive.com>

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut
24 changes: 14 additions & 10 deletions lib/Plack/Session/Store/DBI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ sub new {
}

$params{table_name} ||= 'sessions';
$params{serializer} ||=
$params{serializer} ||=
sub { MIME::Base64::encode_base64( Storable::nfreeze( $_[0] ) ) };
$params{deserializer} ||=
$params{deserializer} ||=
sub { Storable::thaw( MIME::Base64::decode_base64( $_[0] ) ) };

my $self = bless { %params }, $class;
Expand All @@ -51,18 +51,18 @@ sub store {
my ($self, $session_id, $session) = @_;
my $table_name = $self->{table_name};

# XXX To be honest, I feel like there should be a transaction
# XXX To be honest, I feel like there should be a transaction
# call here.... but Catalyst didn't have it, so I'm not so sure

my $sth = $self->_dbh->prepare_cached("SELECT 1 FROM $table_name WHERE id = ?");
$sth->execute($session_id);

# need to fetch. on some DBD's execute()'s return status and
# rows() is not reliable
my ($exists) = $sth->fetchrow_array();
my ($exists) = $sth->fetchrow_array();

$sth->finish;

if ($exists) {
my $sth = $self->_dbh->prepare_cached("UPDATE $table_name SET session_data = ? WHERE id = ?");
$sth->execute( $self->serializer->($session), $session_id );
Expand All @@ -71,7 +71,7 @@ sub store {
my $sth = $self->_dbh->prepare_cached("INSERT INTO $table_name (id, session_data) VALUES (?, ?)");
$sth->execute( $session_id , $self->serializer->($session) );
}

}

sub remove {
Expand Down Expand Up @@ -117,7 +117,7 @@ Plack::Session::Store::DBI - DBI-based session store
);
$app;
};

# with custom serializer/deserializer

builder {
Expand Down Expand Up @@ -146,8 +146,8 @@ Plack::Session::Store::DBI - DBI-based session store
=head1 DESCRIPTION

This implements a DBI based storage for session data. By
default it will use L<Storable> and L<MIME::Base64> to serialize and
deserialize the data, but this can be configured easily.
default it will use L<Storable> and L<MIME::Base64> to serialize and
deserialize the data, but this can be configured easily.

This is a subclass of L<Plack::Session::Store> and implements
its full interface.
Expand All @@ -167,10 +167,14 @@ or larger.

=head1 AUTHORS

Many aspects of this module were partially based upon Catalyst::Plugin::Session::Store::DBI
Many aspects of this module were partially based upon L<Catalyst::Plugin::Session::Store::DBI>

Daisuke Maki

=head1 REPOSITORY

L<https://github.com/stevan/plack-middleware-session.git>

=head1 COPYRIGHT AND LICENSE

Copyright 2009, 2010 Daisuke Maki C<< <daisuke@endeworks.jp> >>
Expand Down
6 changes: 5 additions & 1 deletion lib/Plack/Session/Store/File.pm
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Plack::Session::Store::File - Basic file-based session store

This implements a basic file based storage for session data. By
default it will use L<Storable> to serialize and deserialize the
data, but this can be configured easily.
data, but this can be configured easily.

This is a subclass of L<Plack::Session::Store> and implements
its full interface.
Expand Down Expand Up @@ -144,6 +144,10 @@ to cpan-RT.

Stevan Little E<lt>stevan.little@iinteractive.comE<gt>

=head1 REPOSITORY

L<https://github.com/stevan/plack-middleware-session.git>

=head1 COPYRIGHT AND LICENSE

Copyright 2009, 2010 Infinity Interactive, Inc.
Expand Down
4 changes: 4 additions & 0 deletions lib/Plack/Session/Store/Null.pm
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ to cpan-RT.

Stevan Little E<lt>stevan.little@iinteractive.comE<gt>

=head1 REPOSITORY

L<https://github.com/stevan/plack-middleware-session.git>

=head1 COPYRIGHT AND LICENSE

Copyright 2009, 2010 Infinity Interactive, Inc.
Expand Down