Home > Backend Development > PHP Tutorial > destoon在360浏览器下出现用户被强行注销的解决方法_php实例

destoon在360浏览器下出现用户被强行注销的解决方法_php实例

WBOY
Release: 2016-05-17 08:40:33
Original
1026 people have browsed it

destoon用户在使用360浏览器时总是会自动退出,经查后发现是cookie丢失造成的,但丢失的原因众说不一!
对此的解决方法也不同,测试发现修改360浏览器的设置,或者IE的兼容性视图设置等均无效。

经验证后可行的解决方法如下:

增加 session 用来保存用户的auth信息

1.在 /module/member/member.class.php 的 364行增加以下代码:

if(!is_object($session)) $session = new dsession();
$_SESSION['auth'] = $auth;
$_SESSION['username'] = $user['username'];
Copy after login

2.在 /module/member/member.class.php 的logout方法中增加以下代码:

session_destroy();
Copy after login

修改后的logout的代码如下:

function logout() {
set_cookie('auth', '');
session_destroy();
return true;
}
Copy after login

3.在根目录的 common.inc.php 找到:

$destoon_auth = get_cookie('auth');
Copy after login

替换为如下代码:

$destoon_auth='';
if(get_cookie('auth')){
    $destoon_auth = get_cookie('auth');
}else{
    $destoon_auth = isset($_SESSION['auth'])?$_SESSION['auth']:'';
}
Copy after login

完成后问题得以解决!

Related labels:
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