unset火狐无效
unset($_SESSION['user']);
火狐无效,谷歌是OK的,不知道为啥,火狐是不是有什么特别要求
还有用火狐F12,会有安全问题,提示“密码字段出现在一个不安全的页面(http://)中。这是一个导致用户的登陆凭据可被窃取的安全风险。”
使用POST提交的用户名和密码,但是用了iframe来获取处理登陆的php的内容,是不是这样做不安全
回复讨论(解决方案)
提示“密码字段出现在一个不安全的页面(http://)中。这是一个导致用户的登陆凭据可被窃取的安全风险。”
意思就是你的密??出去?是明文,?有加密,容易被?取。用https就不?提示的。?句?可以不理的。
是用?名和密?post到iframe ?面做???? 不?不安全啊。
unset($_SESSION['user']) 不行?? ?句是在iframe?面?
unset($_SESSION['user'])
这句直接写在一个logout.php里,
点击“退出”就会连接到这个文件,火狐里没法注销这个session,谷歌和360是正常的
用firefox测试了一下。
a.php
<?phpsession_start();$_SESSION['user'] = 'fdipzone';?>
b.php
<?phpsession_start();if(isset($_SESSION['user'])){ unset($_SESSION['user']); var_dump($_SESSION['user']);}?>
var_dump NULL 很正常。
如果真的不能unset,可以执行$_SESSION['user'] = NULL;
var_dump 输出是NULL
找到原因了,原来是火狐回退不会刷新页面,判断登陆状态的js没有执行
logout.php 里是这么写的
unset($_SESSION['user']);
echo "<script> history.go(-1)</script>";
火狐回退,$(document).ready(function(){}里的函数为啥不会运行呢
谷歌是会运行的
看?是你的firefox有??了。???了,一切正常。
重新下了个火狐,还是一样,这情况是在太怪了
以前写验证码类的时候碰到过这个问题
window.onload的时候,我刷新了验证码图片
火狐提交表单再后退验证码不变,IE刷新
当时查了下资料,火狐的内核会为所有选项卡各自在内存中保存历史记录,当发生回退时其实仅仅读取了内存,js运行状态也就保存了下来。而IE内核的回退就好像是直接输入地址一样
echo "<script> history.go(-1)</script>";
改成跳转header("Location:xx.php");试试
session 是存放在服务器上的
只要浏览器能传递正确的 sessionid ,其他的就与浏览器无关了
unset($_SESSION['user']);
并不能注销 session,而只是从 session中删去了 uesr 项
显然这句是有条件执行的,所以你应检查删除的条件是否成立
而传递删除条件就与浏览器有关了
以前写验证码类的时候碰到过这个问题
window.onload的时候,我刷新了验证码图片
火狐提交表单再后退验证码不变,IE刷新
当时查了下资料,火狐的内核会为所有选项卡各自在内存中保存历史记录,当发生回退时其实仅仅读取了内存,js运行状态也就保存了下来。而IE内核的回退就好像是直接输入地址一样
那这个问题有啥办法解决不
echo "<script> history.go(-1)</script>";
改成跳转header("Location:xx.php");试试
改成这个就正常了。。
session 是存放在服务器上的
只要浏览器能传递正确的 sessionid ,其他的就与浏览器无关了
unset($_SESSION['user']);
并不能注销 session,而只是从 session中删去了 uesr 项
显然这句是有条件执行的,所以你应检查删除的条件是否成立
而传递删除条件就与浏览器有关了
删除应该是成功的,因为火狐回退没效果,但是刷新一下就好了
那这个问题有啥办法解决不
像9楼那样,用php的header Location 或者window.location.href 避免程序中后退
用户自己按后退那就是他的问题了
用header('location: '.$_SERVER['HTTP_REFERER']);解决了,多谢大家

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The Linux version of Firefox has been updated to Firefox 110. This update supports importing data from Opera and Vivaldi browsers, enabling the GPU sandbox function in the Windows version, etc. In addition, it also greatly improves performance and security. Supports importing data from more browsers In addition to the currently supported Edge, Chrome and Safari browsers, the Firefox 110 version also adds the ability to import bookmarks, history and passwords from Opera, OperaGX and Vivaldi browsers. This feature provides convenience for all users considering switching to Firefox, allowing them to easily migrate important information they have saved in other browsers. Thus

Solving the problem of PHP error: Invalid class constant In PHP development, we often encounter the following error message: Fatalerror: Undefinedclassconstant'CONSTANT_NAME'in/path/to/file.phponline10 This kind of error message indicates that it is used in the code An invalid class constant name was obtained. Solving this problem is actually not difficult. Below I will introduce several possibilities in detail.

Steps to remove the Firefox security lock: 1. Open the Firefox browser and make sure you are logged in to your account; 2. Click the "three horizontal lines" icon in the upper right corner of the browser to open the menu; 3. In the menu, select "Options" or "Preferences"; 4. In the settings page that opens, select the "Privacy and Security" tab; 5. In this tab, find the "Security Lock" or "Security Lock" option and click it; 6. In the pop-up window, you will see a password input box. This is to verify whether you have the authority to release the security lock, if you have not set a password before, etc.

"What should I do if the Chinese setting of VSCode is invalid?" 》Visual Studio Code (VSCode for short) is a powerful open source code editor loved by many developers. However, sometimes you may encounter some problems when setting up the Chinese environment, such as the situation where the Chinese setting is invalid. This article will discuss this issue and provide specific code examples to help readers solve this problem. 1. Confirm the system language setting. First, we need to confirm whether the language setting of the operating system is correct. exist

What should I do if the spreadsheet cannot be opened and the file format is invalid? In modern society, spreadsheets have become one of the indispensable tools in work and study. However, sometimes we may encounter a situation where the spreadsheet cannot be opened, and an error message indicating that the file format is invalid may appear. So, when we encounter this situation, how should we solve it? First, let’s be clear that an invalid file format error message usually means there’s a problem opening the spreadsheet. This may be due to corruption in the file itself, or the software used

The effect of margin on inline elements is different from that of block-level elements. In inline elements, the margin attribute only affects the vertical top and bottom margins, not the horizontal left and right margins. For example, if there is a paragraph element in HTML, we can set some styles for it and observe the effect of the margin attribute on it. The HTML code looks like this:

PHP is a popular server-side programming language that provides many useful features, one of which is manipulating arrays. When using PHP arrays, sometimes you need to delete elements. In this case, you can use the unset() function. The unset() function is a function used in PHP to delete variables and can be used to delete elements in an array. Its syntax is as follows: unset(array$array[,mixed$key1[,mixed$key2[,mixed

What to do about invalid Windows images In the process of using the Windows operating system, sometimes we may encounter the problem of invalid Windows images. This kind of problem will cause us to be unable to start the computer normally or be unable to run certain applications. So, how should we solve it when we encounter an invalid Windows image? First, we need to clarify what exactly an invalid Windows image means. Typically, this is caused by corrupted or missing computer system files. causing system
