Added cookie storage for fun and profit! also checking if login is needed