php浏览器关闭前一直登录,cookie关闭浏览器怎么不过期, 如何做的关闭浏览器就退出登陆?...

$params = require(__DIR__ . '/params.php');

$db = require(__DIR__ . '/db.php');

$config = [

'id' => 'basic',

'basePath' => dirname(__DIR__),

'bootstrap' => ['log'],

'language' => 'zh-CN',

'components' => [

'assetManager' => [

'assetMap' => [

// 'jquery.js' => '@web/js/jquery-1.11.1.min.js',

],

// 'bundles' => [

// 'yii\web\JqueryAsset' => [

// 'sourcePath' => null,

// 'js' => []

// ],

// ],

],

'authManager' => [

'class' => 'yii\rbac\DbManager',

],

'formatter' => [

'class' => 'yii\i18n\Formatter',

'nullDisplay' => '',

],

'request' => [

// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation

'cookieValidationKey' => 'IdMsnYBmQFgfd9fz4m3vh_BOx61mfPWUZ',

'enableCookieValidation' => false,

],

'cache' => [

'class' => 'yii\caching\FileCache',

],

'user' => [

'identityClass' => 'app\models\Operator',

'enableAutoLogin' => false,

],

'errorHandler' => [

'errorAction' => 'site/error',

],

'mailer' => [

'class' => 'yii\swiftmailer\Mailer',

// send all mails to a file by default. You have to set

// 'useFileTransport' to false and configure a transport

// for the mailer to send real emails.

'useFileTransport' => true,

],

'log' => [

'traceLevel' => YII_DEBUG ? 3 : 0,

'targets' => [

[

'class' => 'yii\log\FileTarget',

'levels' => ['info'],//这里说明配置的是那个,如error,warning,info,trace这些

'categories' => ['info'],//这里说明的保存的文件名

'logFile' => '@app/runtime/logs/info.log',//这里说明的保存的文件名的路径

'maxFileSize' => 1024 * 2,//这些一看就知道的就不说明了

'maxLogFiles' => 20,

],

[

'class' => 'yii\log\FileTarget',

'levels' => ['error', 'warning', 'info'],

],

],

],

'db' => $db['db1'],

'urlManager' => [

'enablePrettyUrl' => true,

'enableStrictParsing' => false, //不启用严格解析

'showScriptName' => false, //隐藏index.php

'suffix'=>'.jsp',

'rules' => [

// '//' => '//view',

// '/' => '/view',

's'=>'/index',

'/'=>'/view',

'//'=>'/',

],

],

],

'params' => $params,

];

if (YII_ENV_DEV) {

// configuration adjustments for 'dev' environment

// $config['bootstrap'][] = 'debug';

// $config['modules']['debug'] = [

// 'class' => 'yii\debug\Module',

// // uncomment the following to add your IP if you are not connecting from localhost.

// 'allowedIPs' => ['127.0.0.1', '::1'],

// ];

$config['bootstrap'][] = 'gii';

$config['modules']['gii'] = [

'class' => 'yii\gii\Module',

// uncomment the following to add your IP if you are not connecting from localhost.

//'allowedIPs' => ['127.0.0.1', '::1'],

];

}

return $config;

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值