-----one procedure would execute upon login
issue the alter user command to set all db roles to default.

-----the other would execute upon logout
issue the alter user command to only set the connect role as default.

can i know

what is the advantage of toggling like this?

what is the problem of leaving the roles to what you want?

what is the effect of setting it to something else,
when the user is logged out?

-Raja