Преглед изворни кода

cookie 本地开发也用安全模式

visuddhinanda пре 2 година
родитељ
комит
7b75fd81d1
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      public/app/ucenter/index.php

+ 4 - 1
public/app/ucenter/index.php

@@ -164,12 +164,15 @@ if (isset($_POST["op"]) && $_POST["op"] == "new") {
                 $jwt = JWT::encode($payload,$key,'HS512');
                 //End of JWT
                 // set cookie
+                /*
 				if(empty($_SERVER["HTTPS"])){
                     //本地开发
 					setcookie("user_uid", $user_uuid,["expires"=>$ExpTime,"path"=>"/","secure"=>false,"httponly"=>true]);
 					setcookie("user_id", $Fetch[0]["id"], ["expires"=>$ExpTime,"path"=>"/","secure"=>false,"httponly"=>true]);
 					setcookie("token", $jwt, ["expires"=>$ExpTime,"path"=>"/","secure"=>false,"httponly"=>true]);
-				}else{
+				}else
+                */
+                {
                     //服务器运行
 					setcookie("user_uid", $user_uuid, ["expires"=>$ExpTime,"path"=>"/","secure"=>true,"httponly"=>true]);
 					setcookie("user_id", $Fetch[0]["id"], ["expires"=>$ExpTime,"path"=>"/","secure"=>true,"httponly"=>true]);