Apache-Session-Wrapper

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


0.28   2006-05-23

- Allow a session_id parameter to the constructor, to force the use of
  a particular existing session.

- Fixed a bug where failing to create a new session was ignored if
  allow_invalid_id was true.

- Detect very weird case where tying to tie to Apache::Session
  succeeds but the tied hash has no _session_id key. This now throws
  an exception.

- Fixed bug when the header_object ->can('header_out') but this method
  does not return an object, as with HTML::Mason::FakeApache. Reported
  by Hans Dieter.

- The logic to load an appropriate cookie class if the class was
  already loaded and an exception had previously been thrown by an
  unrelated class.

- Added a way to register session subclass via RegisterClass() and
  RegisterFlexClass(), to allow people to use any session subclass
  they want without needing explicit support in
  Apache::Session::Wrapper.


0.27   not released

Changes  view on Meta::CPAN

0.24   2005-08-01

- Optional parameters for store modules were not handled properly when
  using Flex as the session class.  Added some tests.  Reported by
  Gavin Carr.


0.23   2005-07-26

- If two sets of valid parameters for a class shared a parameter, an
  error would be thrown if you used the second set, even if it was
  complete.  Reported by Victor Felix.


0.22   2005-07-18

- Another fix for mod_perl2, this one from Jonas.


0.21   2005-06-20

Changes  view on Meta::CPAN

  equivalent to undef, and causes the cookie to expire when the
  browser is closed.  Requested by Herald (RT #5615) for
  MasonX::Request::WithApacheSession.

- Remove some incorrect default values for some parameters, which were
  being set to undef when they shouldn't be.


0.12   2004-02-26

- Document that constructor can throw an exception.

- Document that session method accepts a session_id parameter.


0.11   2004-02-26

- Change default cookie name to "Apache-Session-Wrapper-cookie".

- Add subclassing docs.

lib/Apache/Session/Wrapper.pm  view on Meta::CPAN

sub _handle_tie_error
{
    my $self = shift;
    my $err = shift;
    my $session_id = shift;

    if ( $err =~ /Object does not exist/ && defined $session_id )
    {
        return if $self->{allow_invalid_id};

        Apache::Session::Wrapper::Exception::NonExistentSessionID->throw
            ( error => "Invalid session id: $session_id",
              session_id => $session_id );
    }
    else
    {
        my $error =
            $err ? $err : "Tying to Apache::Session::$self->{session_class_piece} failed but did not throw an exception";
        die $error;
    }
}

sub _bake_cookie
{
    my $self = shift;

    my $expires = shift || $self->{cookie_expires};
    $expires = undef if defined $expires && $expires =~ /^session$/i;

lib/Apache/Session/Wrapper.pm  view on Meta::CPAN


This class provides the following public methods:

=over 4

=item * new

This method creates a new C<Apache::Session::Wrapper> object.

If the parameters you provide are not correct (wrong type, missing
parameters, etc.), this method throws an
C<Apache::Session::Wrapper::Exception::Params> exception.  You can
treat this exception as a string if you want.

=item * session

This method returns a hash tied to the C<Apache::Session> class.

This method accepts an optional "session_id" parameter.

=item * delete_session

lib/Apache/Session/Wrapper.pm  view on Meta::CPAN

behavior is used instead.

This defaults to true.

=item * allow_invalid_id  =>  boolean

If this is true, an attempt to create a session with a session id that
does not exist in the session storage will be ignored, and a new
session will be created instead.  If it is false, a
C<Apache::Session::Wrapper::Exception::NonExistentSessionID> exception
will be thrown instead.

This defaults to true.

=item * session_id  =>  string

Try this session id first and use it if it exist. If the session does
not exist, it will ignore this parameter and make a new session.

=back



( run in 0.727 second using v1.01-cache-2.11-cpan-496ff517765 )