On a site I'm working on, we have forums for both OG groups and a site-wide forum. If a user has been on the forums of a group they belong to, then when they try to post to the site wide forums, they get redirected to the forum creation form of the last group they visited. Looking into the code, I found this was because $_SESSION['og_last'] held the gid of the group that gave the user roles. This made it impossible to create content without an OG context.

I've attached a small patch that removes the og_last variable from sessions if no group context could be found. Thus enabling site-wide content creation again.