--- loncom/auth/checkauthen.pm 2007/04/11 21:36:58 1.11 +++ loncom/auth/checkauthen.pm 2007/10/02 01:09:59 1.12 @@ -1,7 +1,7 @@ # The LearningOnline Network # checks for a cokkie to authenticate a user # -# $Id: checkauthen.pm,v 1.11 2007/04/11 21:36:58 raeburn Exp $ +# $Id: checkauthen.pm,v 1.12 2007/10/02 01:09:59 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -61,17 +61,12 @@ sub handler { } } - my %cookies=CGI::Cookie->parse($r->header_in('Cookie')); - my $lonid=$cookies{'lonID'}; - my $handle; - if ($lonid) { - $handle=&LONCAPA::clean_handle($lonid->value); - $handle = $r->dir_config('lonIDsDir')."/$handle.id"; - } else { + my $handle = &Apache::lonnet::check_for_valid_session($r); + if ($handle eq '') { $handle = $env{'user.environment'}; } - if (($handle ne '') && (-e $handle)) { + if ($handle ne '') { return OK; }