comparison Lib/IMPL/Web/QueryHandler/SecureCookie.pm @ 74:84aa8c395fce

doc minor fixes
author wizard
date Mon, 29 Mar 2010 17:40:06 +0400
parents 2f31ecabe9ea
children 915df8fcd16f
comparison
equal deleted inserted replaced
73:2f31ecabe9ea 74:84aa8c395fce
22 my $method = $action->query->cookie('method') || 'simple'; 22 my $method = $action->query->cookie('method') || 'simple';
23 23
24 if ($method eq 'simple') { 24 if ($method eq 'simple') {
25 25
26 my $sid = $action->query->cookie('sid'); 26 my $sid = $action->query->cookie('sid');
27 my $cookie = $action->query->cookie('cookie');
27 28
28 if ($action->query->cookie('sign') eq md5_hex( 29 if ($action->query->cookie('sign') eq md5_hex(
29 $this->salt, 30 $this->salt,
30 $sid, 31 $sid,
32 $cookie,
31 $this->salt 33 $this->salt
32 ) ) { 34 ) ) {
33 35
34 my $context = $action->application->security->Session( 36 my $context = $action->application->security->Session(
35 id => $sid 37 id => $sid
36 ); 38 );
37 39
38 my ($result,$challenge) = $context->auth->ValidateSession($sid); 40 my ($result,$challenge) = $context->auth->ValidateSession($cookie);
39 41
40 if ($result == AUTH_SUCCESS) { 42 if ($result == AUTH_SUCCESS) {
41 return $context->Impersonate($nextHandler); 43 return $context->Impersonate($nextHandler);
42 } else { 44 } else {
43 return $nextHandler->(); 45 return $nextHandler->();