Solution to the problem that users are forcibly logged out under destoon 360 browser_PHP tutorial

WBOY
Release: 2016-07-13 10:26:10
Original
950 people have browsed it

destoon users always log out automatically when using 360 browser. After checking, it was found that it was caused by the loss of cookies, but the reasons for the loss are different!
The solutions to this are also different. Tests have found that modifying the settings of the 360 ​​browser or the compatibility view settings of IE are ineffective.

The proven and feasible solutions are as follows:

Add session to save user’s auth information

1. Add the following code in line 364 of /module/member/member.class.php:

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

2. Add the following code in the logout method of /module/member/member.class.php:

session_destroy();
Copy after login

The modified logout code is as follows:

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

3. Find common.inc.php in the root directory:

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

with the following code:

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

Problem solved after completion!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/824782.htmlTechArticledestoon users always automatically exit when using the 360 ​​browser. After checking, it was found that it was caused by the loss of cookies. But the reasons for the loss vary! The solutions to this are also different, testing found...
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!