cookie updating and stuff