简体   繁体   English

使用PHP在客户端删除Cookie

[英]Remove cookies on client side with PHP

I've made a login portal from my site to automatically login in other site. 我已经从我的站点建立了一个登录门户,以自动登录其他站点。 It works perfect. 完美的作品。 However, when I logged out I cannot login back from my site anymore because the site does not remove the last session. 但是,当我注销后,由于该站点不会删除上一个会话,因此无法再从该站点重新登录。 So I only can login when I started a new session, and can't login again with the same session for the next session after logged out. 因此,我只能在开始新的会话时登录,并且注销后无法在下一个会话的同一会话中再次登录。

I've asked the other site, and they suggest me to remove the cookie which is stored on the client side. 我问过另一个站点,他们建议我删除存储在客户端的cookie。 How is it possible to remove cookies on client side from other sites with PHP?? 如何使用PHP从其他站点删除客户端的cookie?

Thanks 谢谢

setcookie(“ TestCookie”,“”,time()-3600); //将时间设置为减去以删除cookie。

to delete cookie set it's expiry time to past, 删除cookie设置为过期时间,

setcookie ("TestCookie", "", time() - 3600);

more see in PHP manual cookie's manual . 更多信息请参见PHP手册cookie的手册

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM