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();