[WIP] Allow control over session autostart

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | na
| License       | MIT
| Doc PR        | todo

Refs #6036

Todo

- [ ] Do documentation

This PR allows two things. One is to control session "start on demand" and the other is to emulate PHP's session behaviour in that `$_SESSION` is `null` but you could read/write to it anyway before a session is started. This is emulated by allowing the session to return bags when the session is not started and which may be overwritten when the session starts.