小编Moo*_*les的帖子

Laravel登录不在边缘和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 …
Run Code Online (Sandbox Code Playgroud)

php internet-explorer login laravel-5 microsoft-edge

8
推荐指数
2
解决办法
2978
查看次数