--- loncom/auth/migrateuser.pm 2007/09/29 02:09:50 1.11 +++ loncom/auth/migrateuser.pm 2007/10/01 21:52:50 1.12 @@ -1,7 +1,7 @@ # The LearningOnline Network # Starts a user off based of an existing token. # -# $Id: migrateuser.pm,v 1.11 2007/09/29 02:09:50 albertel Exp $ +# $Id: migrateuser.pm,v 1.12 2007/10/01 21:52:50 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -87,16 +87,8 @@ sub handler { my $extra_env = &sso_check(\%data); if (!$data{'role'}) { - # check for exisiting valid session - my %cookies=CGI::Cookie->parse($r->header_in('Cookie')); - my $lonid=$cookies{'lonID'}; - my $handle; - if ($lonid) { - $handle=&LONCAPA::clean_handle($lonid->value); - } - if ($lonid - && -e $r->dir_config('lonIDsDir').'/'.$handle.'.id' - && $handle ne '') { + my $handle = &Apache::lonnet::check_for_valid_session($r); + if ($handle) { &Apache::lonnet::transfer_profile_to_env($r->dir_config('lonIDsDir'), $handle); if ($env{'request.course.id'}) {