Laravel登录不支持edge和ie浏览器


Laravel login not working in edge and internet explorer

使用Laravel 5登录不能与Edge和Internet Explorer一起工作,而在其他浏览器中运行良好。

我们怀疑这与会话没有正确存储有关,但说实话,我们不知道是什么原因导致了这个问题。

当我们使用适当的详细信息登录时,登录逻辑被触发并正确完成,但之后它只是重定向回登录页面,因此很可能中间件认为用户没有登录并将其返回到登录页面,这就是为什么我们认为它与会话有关。

这是我们的登录脚本:
    $rules = array('email' => 'required|email|min:3|max:60',
                   'password' => 'required|min:6|max:20');
    $attributeNames = array(
       'email' => strtolower(Lang::get('auth.email')),
       'password' => strtolower(Lang::get('auth.password')),     
    );
    $validator = Validator::make(Input::all(), $rules);
    $validator->setAttributeNames($attributeNames);
    if ($validator->fails()){ return Redirect::back()->withErrors($validator); die(); } 
    //Make an login attempt
    $auth = Auth::attempt(array(
        'email' => Input::get('email'),
        'password' => Input::get('password'),
        'role' => 'admin'
    ), false);
    if(!$auth){ 
        $auth2 = Auth::attempt(array(
            'email' => Input::get('email'),
            'password' => Input::get('password'),
            'role' => 'user'
        ), false);
        if(!$auth2){ 
            return Redirect::back()->withErrors(Lang::get('auth.errorText'))->withInput(Input::all());
            die();
        }
    }
    //If user is not activated
    if(Auth::User()->activated != 'OK'){
        Auth::logout();
        return Redirect::back()->withErrors(Lang::get('auth.notActivated'));
        die();
    }
    if(Auth::User()->sms_verificatie == '1') {
        $user = Auth::User();
        $user->sms_ok = 0;
        $user->save();
        $sms_codes_verwijderen = UsersSMSLogin::where('id_cms_users','=',Auth::User()->id)->delete();
        return Redirect::route('sms-verificatie');
        die();
    }
    Session::forget('dashboard_werkgever');
    return Redirect::route('dashboard');

更改cookie名称以删除_(下划线)。

app/config/session.php改变

'cookie' => 'laravel_session'

'cookie' => 'laravelsession'

这个问题似乎与Google分析有关,我们在Edge和internet explorer中删除了分析脚本,现在一切似乎都工作得很好…

只是为了帮助任何人,我最近有一个非常类似的问题。原来我有两个web应用程序在同一域共享相同的会话cookie名称,而一些浏览器发送正确的cookie(我想纯粹是运气),IE不是。

从中吸取教训?始终更改默认的laravel_session cookie名称:)

这篇文章证明是有用的…如何处理具有相同名称的多个cookie ?