--- loncom/auth/lonauth.pm 2018/07/01 00:03:42 1.153 +++ loncom/auth/lonauth.pm 2018/07/04 16:58:19 1.154 @@ -1,7 +1,7 @@ # The LearningOnline Network # User Authentication Module # -# $Id: lonauth.pm,v 1.153 2018/07/01 00:03:42 raeburn Exp $ +# $Id: lonauth.pm,v 1.154 2018/07/04 16:58:19 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -76,8 +76,9 @@ sub success { # ----------------------------------------------------------- Get cookies ready my ($securecookie,$defaultcookie); - if ($ENV{'SERVER_PORT'} == 443) { - $securecookie="lonID=$cookie; path=/; HttpOnly; secure"; + my $ssl = $r->subprocess_env('https'); + if ($ssl) { + $securecookie="lonSID=$cookie; path=/; HttpOnly; secure"; my $lonidsdir=$r->dir_config('lonIDsDir'); if (($lonidsdir) && (-e "$lonidsdir/$cookie.id")) { my $linkname=substr(Digest::MD5::md5_hex(Digest::MD5::md5_hex(time(). {}. rand(). $$)), 0, 32).'_linked'; @@ -88,7 +89,7 @@ sub success { "$lonidsdir/$linkname.id"); 1 }; if ($made_symlink) { $defaultcookie = "lonLinkID=$linkname; path=/; HttpOnly;"; - &Apache::lonnet::appenv({'user.linkedenv' => "$lonidsdir/$linkname.id"}); + &Apache::lonnet::appenv({'user.linkedenv' => $linkname}); } } } else {