added logout button to public download / upload

improved logout layout and logic

cleaned up code duplication