PHP判断用户session是否存在问题,放在<html>之前不起作用

WBOY
Release: 2016-06-23 14:21:39
Original
943 people have browsed it

PHP session 火狐 PHP session

]<?phprequire_once ('config.php');//判断用户权限	if($_SESSION['member'] != "admin"){	echo "<script>alert('请进行登陆');location='index.php';</script>";	}?>
Copy after login


放在之前不起作用,放在之内,火狐做了判断,但是ie依然不起作用

回复讨论(解决方案)

session和cookie是亲兄弟。

session_start()是对session信息进行初始化(在一定的概率下删除存在服务器的session文件,这个概率在php.ini中可以设置).

有不用session_start()也能访问session信息。。是因为你的cookie还在。然后服务器上的session文件也还在。这样就能读取到了。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template