加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

php – Laravel登录不在边缘和Internet Explorer中工作

发布时间:2020-12-14 19:47:08 所属栏目:大数据 来源:网络整理
导读:使用Laravel 5登录无法使用Edge和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'),'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’

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读