Home  >  Article  >  Backend Development  >  Solution to the problem that users are forcibly logged out under destoon 360 browser_PHP tutorial

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

WBOY
WBOYOriginal
2016-07-13 10:26:10934browse

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'];

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

session_destroy();

The modified logout code is as follows:

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

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

$destoon_auth = get_cookie('auth');
Replace

with the following code:

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

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...
Statement:
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