向现有会话添加密钥和值

I try to add a key and a value in a already existing session with laravel and this goes fine but the key is not as I pass with the Session function

public function selectCar() {

    $reservation['car'] = Input::get('id'); 

    if (Session::has('car')) {
        Session::forget('car');
    }

    if (Input::has('id'))
    {
        Session::push('reserveringen', $reservation['car']);
    }

    $data = Session::all();
    return Redirect::back()->with('success', 'Auto gekozen')->with('sessie', $data);

}

The output is

[reserveringen] => Array
            (
                [pickupdate] => 'date'
                [pickuptime] => 'time'
                [returndate] => 'date'
                [returntime] => 'time'
                [0] => 37
            )

But It shows 0 instead of 'car' The next thing is that if the session already contains car I want the old one to delete and be replace by the new one. Can someone give me an example of how to achieve this?

You are not passing the array key, so this is a way to pass it:

if (Input::has('id'))
{
    Session::push('reserveringen', array('car' => $reservation['car']));
}

But it will push an new array to that array, not your 'car' key.

So, you might need to do this to put your 'car' key correctly:

$reserveringen = Session::get('reserveringen');

$reserveringen['car'] = $reservation['car'];

Session::put('reserveringen', $reserveringen);