File: TestAppDefaults.pm

package info (click to toggle)
libcgi-application-plugin-session-perl 1.06-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 244 kB
  • sloc: perl: 533; makefile: 2
file content (34 lines) | stat: -rw-r--r-- 615 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package TestAppDefaults;

use strict;

use CGI::Application;
use CGI::Application::Plugin::Session;
@TestAppDefaults::ISA = qw(CGI::Application);

sub setup {
    my $self = shift;

    $self->start_mode('test_mode');

    $self->run_modes(test_mode => 'test_mode' );
}

sub test_mode {
	my $self = shift;
  my $output = '';

  my $session = $self->session;

  $output .= $session->is_new ? "session created\n" : "session found\n";
  my $value = $session->param('value') || "";
  $output .= "value=$value\n";
  $output .= "id=".$session->id."\n";

  $session->param('value' => 'test1');
  
  return $output;
}


1;