Hi,
For simplicity and not breaking other stuff :) I would keep the old logic ...
I suppose you are using the Laravel standard Auth, in order to make your logic work try this:
Auth\LoginController.php add
/**
* Send the response after the user was authenticated.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
protected function sendLoginResponse(Request $request)
{
$request->session()->regenerate();
$this->clearLoginAttempts($request);
Session::put('year', request()->year');
return $this->authenticated($request, $this->guard()->user())
?: redirect()->intended($this->redirectPath());
}
and then you can Session::get('year) anywhere after login. (I didn't test ;) )
The wise way would be to login without selecting the year/race/etc ... and let the user choose after, then save it in your URL as parks would be more friendly I guess. And of course, the DB structure would be much cleaner with a pivot table ie. user_race; user_id, race_id, year
Good luck