[英]How to start a new session (PHP, WAMP)?
All, 所有,
Probably a stupid question, but I'm developing a small site using WAMP (and Firefox to display the HTML produced), and I can't find a way to start my site with a new session. 可能是一个愚蠢的问题,但是我正在使用WAMP(和Firefox来显示生成的HTML)开发一个小型站点,但是我找不到找到以新会话开始我的站点的方法。 The session persists from one window to the next, with all the user data in session, page count, etc. 会话从一个窗口持续到下一个窗口,会话中的所有用户数据,页数等。
How can I start a new session? 如何开始新的会话?
Thanks, 谢谢,
JDelage JDelage
EDIT: Related thread of interest to others: Firefox session cookies 编辑:感兴趣的其他相关线程: Firefox会话cookie
A session is a combination of a client-side token (stored in Firefox) and PHP remembering some server-side session information for that token. 会话是客户端令牌(存储在Firefox中)和PHP一起记住该令牌的一些服务器端会话信息的组合。
If you want to destory the session client-side, you should clear your cache (or start a new private window). 如果要销毁会话客户端,则应清除缓存(或启动一个新的私有窗口)。 If you want to destroy the session information server-side, you should call 如果要在服务器端销毁会话信息,应致电
session_destroy();
See here for a good tutorial in PHP: http://www.tizag.com/phpT/phpsessions.php 请参阅此处以获取有关PHP的良好教程: http : //www.tizag.com/phpT/phpsessions.php
If you can use Chrome then you can use the File -> New Incognito Window
option. 如果可以使用Chrome,则可以使用File -> New Incognito Window
选项。
In Firefox it is Tools -> Start Private Browsing
. 在Firefox中,它是Tools -> Start Private Browsing
。
These will start clean sessions in your browsers. 这些将在您的浏览器中启动干净的会话。
You can delete the session cooking using the cookie management screen of your browser. 您可以使用浏览器的Cookie管理屏幕删除会话烹饪。
You can create a simple script that destroys your session when it is called. 您可以创建一个简单的脚本来在调用会话时销毁会话。 For example you can have logout.php
: 例如,您可以拥有logout.php
:
session_start();
session_destroy();
The manual page is over at session_destroy()
. 手册页位于session_destroy()
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.