updated logout for https removal, fixed security flaws