I too HAD the problem of more or less being randomly logged out of dnn. This was happening on a DNN portal site running multiple portals, during editing content. When the user wantet to change the target of a link using the URLControl, then the following postback action would result in a redirect to the login screen. I've actually found out what the problem was, after a in depth debugging session through the framework. Here are my findings:
When the URLControl's type value is changed between None, Page, File and/or external, a postback is performed. This postback results in loading of additional controls, including some positioning-images. A 404 error is generated, because the actual image is not found, but being very small, it's placeholder is not visible. This in itself is not a problem, until you've set IIS up to show a specific site-page when a 404-error occurs, as I did.
The actual DNN page that was being shown however was a page from another portal. This reset the current logged in user credentials because the user was not known within the other portal.
Then in the next postback on the edit-page the page would be reloaded, but because the user-context was cleared the user would be redirected to the login page.
Resetting the 404-error to its default in IIS solved the problem. (I didn't write down the file name of the image-file, so don't even ask...)
Regards, Sietse