Issues using SSO in custom web app

One option here is amending the default current user provider via a plugin:

Inheriting off this and adding custom logic to look at parent cookie, then in parent cookie also store the expected user name, if mismatching, nuke cookies.

I am not entirely against amending it so you can force sso when you are already authenticated via a cookie, but it needs to be carefully tested.