Session is simply a VimScript file. You can read through it and see what is going on.
What it does, it re-creates buffer(s) and after that it attempts to restore all previously saved options. By doing so it may overwrite any automatic settings such as &readonly
that were set while the new buffer was being loaded.
IMO, saving options into session script should be avoided.
Refer to :h 'sessionoptions'
:h 'sessionoptions'
to do adjustments.