--- loncom/auth/lonlogout.pm 2007/10/01 20:36:37 1.28 +++ loncom/auth/lonlogout.pm 2007/10/02 01:09:59 1.29 @@ -1,7 +1,7 @@ # The LearningOnline Network # Logout Handler # -# $Id: lonlogout.pm,v 1.28 2007/10/01 20:36:37 albertel Exp $ +# $Id: lonlogout.pm,v 1.29 2007/10/02 01:09:59 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -41,23 +41,16 @@ sub handler { #Check for cookie my $requrl=$r->uri; - my %cookies=CGI::Cookie->parse($r->header_in('Cookie')); - my $lonid=$cookies{'lonID'}; - my $cookie; - if (!$lonid) { - return FORBIDDEN; - } - + my $handle = &Apache::lonnet::check_for_valid_session($r); #check if cookie still valid - my $handle=&LONCAPA::clean_handle($lonid->value); - my $lonidsdir=$r->dir_config('lonIDsDir'); - if ((!-e "$lonidsdir/$handle.id") || ($handle eq '')) { + if ($handle eq '') { $r->log_reason("Cookie $handle not valid", $r->filename); return FORBIDDEN; } #we've got a valid user my @profile; + my $lonidsdir=$r->dir_config('lonIDsDir'); &Apache::lonnet::transfer_profile_to_env($lonidsdir,$handle); unlink("$lonidsdir/$handle.id"); my %temp=('logout' => time);