<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                session配置與獲取 語法: Session::set('鍵名','值'); //設置session Session::set('鍵名',null); //清空session Session::get('鍵名'); //獲取Session值 ## route.php文件 (設置session) ~~~ <?php use think\Route; Route::get('setSess','index/index/setSess'); Route::get('getSess','index/index/getSess'); ~~~ ## index.php文件(設置session) ~~~ use think\Session; public function setSess() { // Session::set('usename','liudehua'); //設置session Session::set('usename',null); //清空session } ~~~ ## 獲取session index.php文件文件 ~~~ use think\Session; public function getSess(Request $request) { echo $request->session('usename'); //獲取session } ~~~ ## 獲取session route.php文件 ~~~ use think\Route; Route::get('getSess','index/index/getSess'); ~~~ ## 清空session index.php文件里 ~~~ public function setSess() { Session::set('usename',null); //清空session } ~~~ ## cookie的方法與session的方法是一樣的 ``` index.php里 use think\Cookie 把上面代碼里的Session改成Cookie就可以 ``` ## 代碼案例: ## index.php里 ~~~ use think\Cookie; public function setCook() { Cookie::set('usename','liudehua'); //設置session // Session::set('usename',null); //清空session } public function getCook(Request $request) { echo $request->Cookie('usename'); //獲取session } } ~~~ ## Route.php文件里 ~~~ Route::get('setCook','index/index/setCook'); Route::get('getCook','index/index/getCook'); ~~~ <br/> <br/> ## Cookie過期時間等其他參數在 config.php文件里設置 <br/> <br/> ~~~ // +---------------------------------------------------------------------- // | Cookie設置 // +---------------------------------------------------------------------- 'cookie' => [ // cookie 名稱前綴 'prefix' => '', // cookie 保存時間 'expire' => 0, // cookie 保存路徑 'path' => '/', // cookie 有效域名 'domain' => '', // cookie 啟用安全傳輸 'secure' => false, // httponly設置 'httponly' => '', // 是否使用 setcookie 'setcookie' => true, ], ~~~ # view模板里讀取session ``` {$Think.session.鍵} ``` 語法案例: {$Think.session.useradmin}
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看