When multiple applications are configured on the same domain with separate ports, users will be constantly logged out of each application as the SESSION_COOKIE_NAME is identical.
This is due to the Tomcat configuration. Please alter the default bundled Tomcat 7 config so that it has a unique Confluence session cookie by modifying the <CONFLUENCE_INSTALL>/conf/context.xml to the following (or something similar):
This will prevent users from getting into this problem in the first place.
Additional workarounds can be found within Logging into Another Atlassian Application Logs Me Out of Confluence.