Tests to verify the behaviour for prototype scope for sessions.
Code changes to add the correct behaviour for prototype scope for sessions.