%once> use CGI::Cookie; use MIME::Base64; use utils; %once> % if(!( defined($username) && defined($password) && % length($username)>1 && length($password)>1 )) { jbovlaste Login
Ah, welcome back <% $userresult->{'realname'} %>.
We're trying to set a cookie in your browser, now. Please accept it, as otherwise I'm not going to think you're logged in after this page.
I promise to be really nice with the cookie. It is set to expire in 30 days, and will only be relayed to exactly this host. The only thing I'm tracking with it is your user ID, and the time of your login.
% if(length($backto)>1) { % } <%perl> # Create and set the cookie. my $time = time; my $data = join(":", length($userresult->{'userid'})+ length($userresult->{'username'})+ length($time), $userresult->{'userid'}, $userresult->{'username'}, $time); my $wrappeddata = encode_base64(utils::encrypt($data), ''); my $cookie = new CGI::Cookie(-name => 'jbovlastesessionid', -value => $wrappeddata, -expires => '+30d', -domain => 'lojban.org' ); $r->headers_out->add('Set-cookie' => $cookie); %perl> % } else {I hate to have to tell you, but there was some sort of problem with your login. Either the user name you just tried is invalid, or the password you tried was incorrect. I'm not allowed to tell you which, sorry. If you are absolutely sure you've reached this message in error, please submit a bug.
If you'd really like, you can try to log in again:
<& loginform &> % } % } <%def loginform> %def> <%args> $username => undef $password => undef $backto => undef %args> <%method title> Login %method>