Php 带有dsdevbe/ldap连接器Auth::check()的Laravel 5返回false

Php 带有dsdevbe/ldap连接器Auth::check()的Laravel 5返回false,php,laravel-5,adldap,Php,Laravel 5,Adldap,我使用dsdevbe/ldap连接器进行Laravel身份验证。为此,我使用了默认的AuthController,并添加了AuthenticatesAndRegistersUsers中的postLogin方法,并做了以下更改: public function postLogin(Request $request) { $this->validate($request, [ 'username' => 'required', 'password'

我使用dsdevbe/ldap连接器进行Laravel身份验证。为此,我使用了默认的AuthController,并添加了AuthenticatesAndRegistersUsers中的postLogin方法,并做了以下更改:

public function postLogin(Request $request)
{
    $this->validate($request, [
        'username' => 'required',
        'password' => 'required',
    ]);

    $credentials = $request->only('username', 'password');

    if ($this->auth->attempt($credentials))
    {
        return redirect()->intended('/dashboard');
    }

    return redirect($this->loginPath())
                ->withInput($request->only('username'))
                ->withErrors([
                    'username' => 'Benutzername oder Passwort falsch.',
                ]);
}
$this->auth->尝试可以正常工作,当我使用不正确的凭据时,我将被重定向到auth/login,但出现错误。当我使用正确的凭据时,我会被重定向到/dashboard,但会话似乎无法正常工作,因为我会获得一个重新编辑权限以进行身份验证/登录。当我尝试添加$this->auth->check时;重定向到dashboard之前的输出为true,重定向到dashboard之后的输出为false

有人知道这个问题并且能帮上忙吗

会话运行良好,使用会话['test'=>true]进行测试;在auth/login blade模板中的尝试下,使用@ifsession'test'{{works}}@endif


谢谢

出于调试目的,请尝试更改会话驱动程序和cookie名称。好的,我明天会尝试!感谢您的回复。我已经将驱动程序设置为cookie,但是我没有注意到任何差异。我通过在LdapUserProvider.php下实现retrieveById方法找到了一个解决方法。你可能想看看