[session] move context manager logic in the security context manager
The `init_security` and `reset_security` method have no other user that the context manager itself. Having dedicated public function is not useful.
option_group_changed('port', 'main', 'web')
option_group_changed('query-log-file', 'main', 'web')
option_group_changed('profile', 'main', 'web')
option_group_changed('max-post-length', 'main', 'web')