Laravel 4-auth.basic过滤器会话未过期|如何使auth.basic会话过期 [英] Laravel 4 - auth.basic filter session doesn't expire | How to expire auth.basic session

查看:75
本文介绍了Laravel 4-auth.basic过滤器会话未过期|如何使auth.basic会话过期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的管理区域,可以在其中更新网站的某些方面.因为我将是唯一访问它的人,所以我想到了使用Laravel 4的auth.basic功能.

I have a simple admin area where I can update some aspects of a website. since I'll be the only one accessing it I thought of using the auth.basic functionality of Laravel 4.

我在routes.php文件上建立了一个组,该组一次将auth.basic过滤器添加到多个资源:

I built a group on my routes.php file that adds the auth.basic filter to several resources at once:

//routes.php

// Password protected routes
Route::group(['before' => 'auth.basic'], function () {
    Route::get('admin', ['as' => 'admin', 'uses' => 'AdminController@index']);
    Route::resource('admin', 'AdminController');
    Route::resource('users', 'UsersController');
    Route::resource('pizzas', 'PizzasController');

});

这些路由受到保护(应有的保护),当我第一次访问其中任何一条路由时,我都必须填写弹出式身份验证表格.

The routes are protected (as they should) and I have to fill a pop-up authentication form when I access any of those routes for the first time.

这是问题所在:我认为,一旦关闭浏览器,经过身份验证的会话就会过期.这没有发生.即使浏览器关闭了几个小时,它仍然记住我".

Here's the problem: I believe the authenticated session should expire once I close the browser. This is not happening. Even if the browser is closed for hours it still "remembers me".

  • 我尝试在config/session.php上设置'lifetime' => 0,.
  • I tried setting 'lifetime' => 0, on config/session.php.

该如何解决此问题?

谢谢.

推荐答案

我认为chrome保存身份验证信息并发送任何请求.因此它可以与会话分开.

i think that chrome save auth info and send in any request. So it can be separate from session.

您可以使用chrome开发工具-> net选项卡进行检查.在任何请求中,Chrome都会自动发送身份验证信息.

you can check it with chrome dev tools -> net tab. in any request chrome automatically send auth info.

您可以检查

auth.basic.once

auth.basic.once

也.

这篇关于Laravel 4-auth.basic过滤器会话未过期|如何使auth.basic会话过期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆