J
joe
Hello I was able to set up cookie authenticaion on my apache2 server
using php. Now I am trying to translate a couple of lines of code from
php to perl but I have not worked with cookies in perl so i am not
sure how to do this. Is there a better way to enable cookie / perl
authenticaion in apache2 or should I just keep hacking this code?
This are the lines of code
http://authmemcookie.sourceforge.net/
$memcache = new Memcache;
$memcache->connect('localhost', 11000) or die ("Could not
connect");
$key=md5(uniqid(rand(), true).$_SERVER["REMOTE_ADDR"].time());
$value="UserName=".$my_user."\r\n";
$value.="Groups=".$my_groups."\r\n";
$value.="RemoteIP=".$my_remoteip."\r\n";
$value.="Expiration=".$my_expiretime."\r\n";
if ($my_send_pass_flag!=FALSE) $value.="Password=".$my_password."\r
\n";
$value.="Email=".$my_mail."\r\n";
$value.="Name=".$my_nom."\r\n";
$value.="GivenName=".$my_prenom."\r\n";
$memcache->set($key,$value,false,$my_expiretime);
if ($my_expiretime!=0) setcookie($my_cookie_name,$key,time()+
$my_expiretime,$my_path,$my_domain,$my_secure);
else setcookie($my_cookie_name,$key,$my_expiretime,$my_path,
$my_domain,$my_secure);
header("Location: ".$my_referer);
exit;
I installed the memcached perl libraries and so far go this but not
sure how to link all the other pieces of code to my perl script
$memcache = new Cache::Memcached {
'servers' => "localhost:11000",
'debug' => 0,
'compress_threshold' => 10_000,
};
using php. Now I am trying to translate a couple of lines of code from
php to perl but I have not worked with cookies in perl so i am not
sure how to do this. Is there a better way to enable cookie / perl
authenticaion in apache2 or should I just keep hacking this code?
This are the lines of code
http://authmemcookie.sourceforge.net/
$memcache = new Memcache;
$memcache->connect('localhost', 11000) or die ("Could not
connect");
$key=md5(uniqid(rand(), true).$_SERVER["REMOTE_ADDR"].time());
$value="UserName=".$my_user."\r\n";
$value.="Groups=".$my_groups."\r\n";
$value.="RemoteIP=".$my_remoteip."\r\n";
$value.="Expiration=".$my_expiretime."\r\n";
if ($my_send_pass_flag!=FALSE) $value.="Password=".$my_password."\r
\n";
$value.="Email=".$my_mail."\r\n";
$value.="Name=".$my_nom."\r\n";
$value.="GivenName=".$my_prenom."\r\n";
$memcache->set($key,$value,false,$my_expiretime);
if ($my_expiretime!=0) setcookie($my_cookie_name,$key,time()+
$my_expiretime,$my_path,$my_domain,$my_secure);
else setcookie($my_cookie_name,$key,$my_expiretime,$my_path,
$my_domain,$my_secure);
header("Location: ".$my_referer);
exit;
I installed the memcached perl libraries and so far go this but not
sure how to link all the other pieces of code to my perl script
$memcache = new Cache::Memcached {
'servers' => "localhost:11000",
'debug' => 0,
'compress_threshold' => 10_000,
};