| OpenFrame-WebApp documentation | Contained in the OpenFrame-WebApp distribution. |
OpenFrame::WebApp::Segment::User::Session - abstract class for working with users stored in sessions.
# abstract - cannot be used directly # set session key: $OpenFrame::WebApp::Segment::User::Session::USER_KEY = 'my_user';
This class contains tools for working with users stored in sessions.
Inherits from OpenFrame::WebApp::Segment::Session.
saves user in the stored session, using $USER_KEY.
gets user from the stored session, using $USER_KEY.
Steve Purkis <spurkis@epn.nu>
Copyright (c) 2003 Steve Purkis. All rights reserved. Released under the same license as Perl itself.
| OpenFrame-WebApp documentation | Contained in the OpenFrame-WebApp distribution. |
package OpenFrame::WebApp::Segment::User::Session; use strict; use warnings::register; use base qw( OpenFrame::WebApp::Segment::Session ); our $VERSION = (split(/ /, '$Revision: 1.1 $'))[1]; our $USER_KEY = 'user'; sub save_user_in_session { my $self = shift; my $user = shift; my $session = $self->get_session_from_store || return; $session->set( $USER_KEY, $user ); return 1; } sub get_user_from_session { my $self = shift; my $session = $self->get_session_from_store || return; return $session->get( $USER_KEY ); } 1; __END__