会话结束后laravel重定向错误

时间:2014-08-12 06:53:33

标签: laravel laravel-4 session-timeout url-redirection

我在我的管理部分使用laravel 4在正常情况下工作正常但是当会话超时并刷新页面而不是正确重定向我的管理员登录路径

localhost/project_name/public/admin/login

当我正确注销其重定向但是当自动会话超出其未转到管理员/登录时,其重定向到跟随路径

localhost/admin/login

所以任何机构都可以告诉我这个解决方案

1 个答案:

答案 0 :(得分:2)

@Deepak Goyal,

定义一个before过滤器来检查routes.php中的内容,例如:

Route::group(["before" => "auth"], function ()
{
//rest of the authenticated routes goes here
}

在filters.php中

Route::filter("auth", function()
{

if (Auth::guest()) return Redirect::guest("admin/login");

});
相关问题