I have a problem with Session that won't persist.
In controller I have a function that loads a article for editing
public function getEdit($id)
{
try {
$news = News::findOrFail($id);
View::share('title', Lang::get('admin.editNews').": ".$news->title);
View::share('news', $news);
$this->layout->content = View::make('news.editNews');
} catch (Exception $e) {
Session::flash('message', Lang::get('admin.noSuchNews'));
Session::flash('notif', 'danger');
return Redirect::to("news");
}
}
And I have another function - index, that should display these flash messages.
public function getIndex()
{
var_dump(Session::get('message'));
}
Session is just not persisting. Not working with Session::flash, not working with Session::put.
Session::get('message') is just always null.
I guess I should mention that I did application routing like this:
Route::controller('news', 'NewsController');
getEditreally called beforegetIndex?News::findOrFail($id)doesn't fail it will load view, and if news is not found it should go tocatch. This also works. Tried echoing$e->getMessage()Redirect::to('news')->with('message', 'your_message');?Session::put('message', Lang::get('admin.noSuchNews')). And when I dump session withSession::all()I only get csrf token_token