Store user state in struct user_t instead of global state