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 != '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'
这个问题似乎与谷歌分析有关,我们删除了边缘和互联网爆炸案中的分析脚本,现在一切似乎都正常......
以防万一它帮助任何人,我最近有一个非常类似的问题。 事实证明,我在同一个域中有两个Web应用程序共享相同的会话cookie名称,而有些浏览器正在发送正确的cookie(纯粹是因为我猜想),IE并不是。
从这个教训? 始终更改默认的laravel_session
cookie名称:)
这个帖子证明是有用的...如何处理多个具有相同名称的cookie?
链接地址: http://www.djcxy.com/p/88351.html上一篇: Laravel login not working in edge and internet explorer