The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Egg::Model::Session::Manager::Base - Base class for session manager.

SYNOPSIS

  package MyApp::Model::Session::Manager;
  use strict;
  use warnings;
  use base qw/ Egg::Model::Session::Manager::Base /;
  
  __PACKAGE__->config(
    .........
    );
  
  __PACKAGE__->startup(
    .........
    );

DESCRIPTION

Egg::Helper::Model::Sesson It is a base class for the Manager class of the component module that generates to use it.

METHODS

This module has succeeded to Egg::Base.

startup ([LOAD_MODULES])

LOAD_MODULES is set up and @ISA of receipt TieHash class is set up.

  __PACKAGE__->startup qw/
    Base::FileCache
    ........
    /;

'Egg::Model::Session' part of the module name given to LOAD_MODULES is omitted and specified. To treat the module name by the full name, '+' is put on the head.

  __PACKAGE__->startup qw/
    +Egg::Plugin::SessionKit::Bind::URI
    ........
    /;

new

¥³¥ó¥¹¥È¥é¥¯¥¿¡£

'MyApp::Model::Session::TieHash' class is done in tie, and the object that does the HASH in the wrapping is returned.

  my $session= $e->model('session_name');

The content of the received object becomes session data. It can access the session by treating the value of the object of this HASH base.

  my $data= $session->{data_key};
  
  $session->{in_data}= 'hoge';

context

The object of the TieHash class is returned.

However, even if the method of the TieHash class is used with the object of this class, the same result is obtained because this class is relaying Egg::Model::Session::Manager::TieHash by AUTOLOAD.

  my $id= $session->context->session_id;
  
     or
  
  my $id= $session->session_id;

close_session

All opened sessions are shut.

In a word, if the two or more sessions have been opened at the same time when two or more component modules have been treated, the all are shut.

  $session->close_session;
  
  # The close method is used to shut individually.
  $session->close

However, because this method is executed with '_finish' hook, it is not necessary to usually consider it on the application side.

SEE ALSO

Egg::Release, Egg::Model::Session, Egg::Model::Session::Manager::TieHash, Egg::Helper::Model::Session, Egg::Base, Class::C3,

AUTHOR

Masatoshi Mizuno <lushe@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2008 Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 113:

Non-ASCII character seen before =encoding in '¥³¥ó¥¹¥È¥é¥¯¥¿¡£'. Assuming CP1252