change cookie handling for velocloud
This commit is contained in:
parent
594a162825
commit
c127ffcbb0
|
@ -157,11 +157,14 @@ sub get_session_cookie {
|
||||||
url_path => $self->{api_path} . $login_url,
|
url_path => $self->{api_path} . $login_url,
|
||||||
query_form_post => $encoded
|
query_form_post => $encoded
|
||||||
);
|
);
|
||||||
my ($cookie) = $self->{http}->get_header(name => 'Set-Cookie');
|
my ($cookies) = $self->{http}->get_header(name => 'Set-Cookie');
|
||||||
$cookie =~ /velocloud.message=(.*);/
|
|
||||||
my $message = $1;
|
my $message = '';
|
||||||
$cookie =~ /velocloud.session=(.*);/
|
my $session = '';
|
||||||
my $session = $1;
|
foreach my $cookie (@{$cookies}) {
|
||||||
|
$message = $1 if ($cookie =~ /velocloud.message=(.*);/);
|
||||||
|
$session = $1 if ($cookie =~ /velocloud.session=(.*);/);
|
||||||
|
}
|
||||||
|
|
||||||
if (!defined($session)) {
|
if (!defined($session)) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Cannot get session cookie: " . $message);
|
$self->{output}->add_option_msg(short_msg => "Cannot get session cookie: " . $message);
|
||||||
|
|
Loading…
Reference in New Issue