Lemonldap::Handlers::Memsession - Plugin for Lemonldap sso system


Lemonldap-Handlers-Generic documentation Contained in the Lemonldap-Handlers-Generic distribution.

Index


Code Index:

NAME

Top

    Lemonldap::Handlers::Memsession  - Plugin  for Lemonldap sso system

DESCRIPTION

Top

 Memsession is the default session backend manager  of lemonldap  websso framework .
 This module uses memcached  in order to store information.

 see http://lemonldap.sf.net for more infos .

Overlay

If you wat use your own session backend method you must use SESSIONSTOREPLUGIN parameter like this : in httpd.conf : perlsetvar lemonldappluginbackend MyModule

 Your module must accept  2 parameters : config (all the hash of config ) and id (collect in the cookie )
 Your module must provide the 'get' method  and return a reference on hash of session.

SEE ALSO

Top

Lemonldap(3), Lemonldap::Portal::Standard

http://lemonldap.sourceforge.net/

"Writing Apache Modules with Perl and C" by Lincoln Stein & Doug MacEachern - O'REILLY

Eric German, <germanlinux@yahoo.fr>
Isabelle Serre, <isabelle.serre@justice.gouv.fr>

COPYRIGHT AND LICENSE

Top


Lemonldap-Handlers-Generic documentation Contained in the Lemonldap-Handlers-Generic distribution.

package Lemonldap::Handlers::Memsession;
use strict;
use Apache::Session::Memorycached;
our ( @ISA, $VERSION, @EXPORTS );
$VERSION = '3.1.0';
our $VERSION_LEMONLDAP = "3.1.0";
our $VERSION_INTERNAL  = "3.1.0";
sub get               
{
    my $class =shift;
    my %_param= @_;
    
    my $id =$_param{'id'};
     return 0 unless $id;;

    my $config =$_param{'config'};

my $SERVERS = $config->{SERVERS};

my %session ;
   tie %session, 'Apache::Session::Memorycached', $id,$SERVERS;
 unless ($session{dn}) {  ##  the cookie is present but i can't  retrieve session
                         ##  three causes : Too many connection are served.              
                         ##                the server of session was restarted                
                         ##                It's time out                 
 
     untie %session ;

# I say it's time out 
                    }
    my %_session = %session;
  untie %session ;
     my $self = \%_session;
    bless $self,$class;
  return $self;
}
1;