rails/rails — pull request #5943 by jordoh (2012-04-23 21:47:05+00:00)
Title: Remove assignment that causes session creation

`ActionDispatch::Request#reset_session` contains the following line:

```
self.session = {}
```

which appears to pre-date when sessions were updated to be lazily created. When using the ActiveRecord session store, calls to `reset_session` will result in `ActionDispatch::AbstractStore#call` creating a session record that is persisted, even if there is no session data (because `{}` is not an `AbstractStore::SessionHash`).

`ActionDispatch::Session::SessionHash#destroy` is already being called on the previous line, which results in the session being cleared and destroyed (if it exists) - and does not result in a new session being created (unless the session is updated after the call to `reset_session`).

As a side note, it seems like the # TODO on `reset_session` has been fulfilled for a couple years now.