Set cookie (userId) for authenticated users