From 20f20d1f570953ea95a345e19e801ae0c12bc4a6 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 25 Jun 2012 12:44:53 +0100 Subject: [PATCH] Ensure that auto_key doesn't contain binary --- SessionHandler.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SessionHandler.pm b/SessionHandler.pm index 9c0ab34..3c24b74 100644 --- a/SessionHandler.pm +++ b/SessionHandler.pm @@ -246,7 +246,7 @@ sub create_session { my $initvars = shift; my $userdata; - # nuke the cookies, it's the only way to be sure + # nuke the cookies from orbit, it's the only way to be sure delete($self -> {"cookies"}) if($self -> {"cookies"}); # get the current time... @@ -827,7 +827,8 @@ sub set_login_key { my $self = shift; my $key = $self -> {"autokey"}; - my $key_id = $self -> {"auth"} -> unique_id(substr($self -> {"sessid"}, 0, 8)); + # key_id needs to be base64 encoded as it may contain binary. + my $key_id = encode_base64($self -> {"auth"} -> unique_id(substr($self -> {"sessid"}, 0, 8)), ''); # If we don't have a key, we want to create a new key in the table if(!$key) {