Inspecting the stack trace you should be able to identify what actually trigger the logout operation.
To be able to properly debug the application, you can even disable Visual Studio 'Just My Code' option and turn on Source Server Support, to navigate the full stack trace instead of a portion of it (the one considered as 'your' code by the debugger).
To be able to properly debug the application, you can even disable Visual Studio 'Just My Code' option and turn on Source Server Support, to navigate the full stack trace instead of a portion of it (the one considered as 'your' code by the debugger).