首页
开发手册
应用中心
工具
用户中心
FoundPHP Session and Cookie
English
中文简体
English
上一篇
下一篇
#### What is Session Session is used to store information about the user's session, or to change the settings of the user's session. The Session variable stores information about a single user and is available to all pages in the application. #### FoundPHP Use Session ```php //store session //in FoundPHP, the value of the stored session can be a string or an array $val = 'FoundPHP Session'; session('foundphp_session',$val); //get session $foundphp_session = session('foundphp_session'); //destroysession session('foundphp_session','[null]'); ``` ####What is a Cookie Cookies are often used to identify users. A cookie is a small file that the server leaves on the user's computer. Whenever the same computer requests a page through a browser, this computer will send a cookie. With PHP, you can create and retrieve cookie values. #### FoundPHP Use Cookies ```php //store cookies //in FoundPHP, the value of the stored cookie can be a string or an array $val = 'FoundPHP Cookie'; cookie('foundphp_cookie',$val); //get cookie $foundphp_cookie = cookie('foundphp_cookie'); //destroycookie cookie('foundphp_cookie','[null]'); ```