]> git.uio.no Git - usit-rt.git/blob - local/plugins/RT-Authen-ExternalAuth/lib/RT/Authen/ExternalAuth/DBI/Cookie.pm
Initial commit 4.0.5-3
[usit-rt.git] / local / plugins / RT-Authen-ExternalAuth / lib / RT / Authen / ExternalAuth / DBI / Cookie.pm
1 package RT::Authen::ExternalAuth::DBI::Cookie;
2
3 use CGI::Cookie;
4
5 use strict;
6
7 # {{{ sub GetCookieVal
8 sub GetCookieVal {
9
10     # The name of the cookie
11     my $cookie_name = shift;
12     my $cookie_value;
13
14     # Pull in all cookies from browser within our cookie domain
15     my %cookies = CGI::Cookie->fetch();
16
17     # If the cookie is set, get the value, if it's not set, get out now!
18     if (defined $cookies{$cookie_name}) {
19       $cookie_value = $cookies{$cookie_name}->value;
20       $RT::Logger->debug(  "Cookie Found",
21                            ":: $cookie_name");
22     } else {
23         $RT::Logger->debug( "Cookie Not Found");
24     }
25
26     return $cookie_value;
27 }
28
29 # }}}
30
31 1;