From 1264f1d355f1a38f868c648dd34218fcd751a1f6 Mon Sep 17 00:00:00 2001 From: Zerozh Date: Fri, 8 Jan 2016 01:29:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=AA=E4=B9=85=E6=B2=A1=E7=94=A8php?= =?UTF-8?q?=E8=87=AA=E5=B8=A6=E7=9A=84session=EF=BC=8C=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=94=A8=E8=BF=99=E6=AE=B5=E4=BB=A3=E7=A0=81=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E6=B2=A1=E6=9C=89=E5=BC=80?= =?UTF-8?q?=E5=90=AFsession=EF=BC=8C$=5FSESSION=20=E6=B0=B8=E8=BF=9C?= =?UTF-8?q?=E6=98=AF=E7=A9=BA=E7=9A=84=EF=BC=8C=E4=BA=8E=E6=98=AF=E6=AF=8F?= =?UTF-8?q?=E4=B8=AA=E8=AF=B7=E6=B1=82=E9=83=BD=E8=B5=B0=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=E5=BE=AE=E4=BF=A1=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 网页授权.md | 1 + 1 file changed, 1 insertion(+) diff --git a/网页授权.md b/网页授权.md index 6c4f930..9a13c19 100644 --- a/网页授权.md +++ b/网页授权.md @@ -104,6 +104,7 @@ $auth->authorize($to = null, $scope = 'snsapi_userinfo', $state = 'STATE') ```php // 请一定要自己存储用户的登录信息,不要每次都授权 +session_start(); if (empty($_SESSION['logged_user'])) { $user = $auth->authorize(); // 返回用户 Bag $_SESSION['logged_user'] = $user->all();