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

NAME

PEF::Front::Session - Session data object

SYNOPSIS

  my $session = PEF::Front::Session->new($context->{request});
  if ($session->data->{name}) {
    $name      = $session->data->{name};
    $is_author = $session->data->{is_author};
  }

DESCRIPTION

This module allows you to easily create sessions , store data in them and later retrieve that information. It uses Storable for data serialisation.

FUNCTIONS

new([$key])

Makes new session object. $key is unique string or request object. If it is empty or omitted then it will be generated. If $key is a request object then it will be looked in request parameters and then in cookies for cfg_session_request_field to get the key.

load()

Loads session data associated with the key.

store()

Stores session data associated with the key. You don't need to call it usually, only when you want to synchronize data with storage.

destroy()

Destroys session data associated with the key.

key()

Returns session key.

data([$hash])

Returns and optionaly sets session data hash.

AUTHOR

This module was written and is maintained by Anton Petrusevich.

Copyright and License

Copyright (c) 2016 Anton Petrusevich. Some Rights Reserved.

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