Isn't it bad practice to change mutable object from outside world in-place? An alternative way:
```python
if not 'autoflush' in session_params:
    # Copy before modifying
    session_params = dict(session_params, autoflush=False)
```