Hey i m having routes in my route file
Route::get('login', array('as' => 'show.login', 'uses' => 'HomeController@showLogin'));
Route::post('login', array('as' => 'do.login', 'uses' => 'HomeController@doLogin'));
Route::get('/', array('as' => 'home.home','uses' => 'HomeController@home'));
Insdie my home controller
public function doLogin(){
$rules = array('email' => 'required|email','password' => 'required');
$validator = Validator::make(Input::all(), $rules);
if ($validator->fails()) {
return Redirect::to('login')->withErrors($validator)->withInput(Input::except('password'));
} else {
$user = Customeruser::where('email', Input::get('email'))->first();
if(!$user) {
$attempt = false;
} else {
$attempt = Auth::attempt(array('email' => Input::get('email') , 'password' => Input::get('password') ));
}
if($attempt) {
//Session::flush();
Session::put('user_id', Auth::user()->uuid);
Session::put('user_name', Auth::user()->first_name." ".Auth::user()->last_name);
Session::put('user_email', Auth::user()->email);
// return Session::all();
// return Redirect::to('/')->with(array('message' => 'Successfully logged in!', 'flash_type' => 'success'));
$occasions = Occasion::with('occasioncategory')->active()->latest()->take(8)->get();
return View::make('home.home' , compact('occasions'));
return Redirect::to('/')->with(array('message' => 'Successfully logged in!', 'flash_type' => 'success'));
}
return Redirect::back()->with(array('message' => 'Invalid credentials, please try again'))->withInput();
}
}
public function home() {
return Session::all();
}
if retrun return Session::all(); from doLogin function before redirect i can able print session on browser
as soon as i redirect i can't able to see my session
What is the issuse can anybody helpme out