Using Laravel 4, I am trying to run some selenium tests but want to auto login users. I have the following but it seems the session ID in the browser differs to that which I can get through the test.
$this->_user = User::create([
...
]);
Auth::login($this->_user);
... or ...
$this->app['auth']->login($this->_user);
Neither work (even with $this->startSession() ).
I have also tried getting the session id from redis and preceeding the two above calls with $this->app['session']->setId($id);
What's the correct way of modifying the session that the browser has?
Edit: I think the problem comes from Auth\Guard::getName generating a unique id