简体   繁体   English

注销文件可在localhost上运行,但不能在iPage上运行

[英]Logout file works on localhost but not on iPage

My logout file works on my localhost, but when I try to use it on my iPage hosting account, it keeps the session saved. 我的注销文件可以在我的本地主机上运行,​​但是当我尝试在iPage托管帐户上使用它时,它将保存会话。 I tested it by printing the session variable on the page which the login redirects to. 我通过在登录重定向到的页面上打印会话变量来测试它。

The code of my logout.php file is: 我的logout.php文件的代码是:

<?php

session_start();
session_destroy();
header("Location: index.php");

?>

Any help? 有什么帮助吗? Thank you 谢谢

After using session_destroy(); 使用session_destroy(); the values in $_SESSION may still be available, but they will not be on the next page load. $ _SESSION中的值可能仍然可用,但不会在下一页加载中。

$_SESSION = array(); // Destroy the variables.

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

相关问题 会话适用于本地主机但不适用于服务器(Ipage 等) - Session works on localhost but not on server (Ipage, etc..) 注销脚本可在localhost上运行,但不能在我的托管服务器上运行 - logout script works on localhost but not on my hosted server logout.php不会重定向到服务器上的预期页面,但可以在localhost上运行 - logout.php does not redirect to intended page on server but works on localhost / admin页上的iPage“未指定输入文件。” - iPage “No input file specified.” on /admin page 上传文件在 localhost 上工作正常,但在 notserver 上工作 - upload file works fine on localhost but work on notserver .htaccess文件是否可以在本地主机上工作? 如果是,如何? - .htaccess file works at localhost or not ?? if yes How? Codeigniter上传文件无法在线运行,但可以在本地主机上运行 - Codeigniter upload file not working online but works on localhost 文件类型和大小限制适用于本地主机,但不适用于虚拟主机 - File type and size limit works on localhost but not on webhost 在 iPage 上托管 Prestashop:前台工作正常,但无法登录后台,没有错误 - Hosting Prestashop on iPage: Front office works, but can't log into back office, there is no error file_get_contents 可以在本地主机上正常工作,而不是在共享主机上 - file_get_contents works right on localhost not on shared hosting
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM