How do I check, if a value already exists within a Session array? I'm trying store active tree objects within a Session array to toggle them on and off:
public function postSelected()
{
$id = Input::get('id');
if (Session::has('user.selection', $id)) { // check?
Session::pull('user.selection', $id);
} else {
Session::push('user.selection', $id);
}
return Response::json(Session::get('user.selection'), 200);
}
Any ideas?