Login and session management sort of work..ish