hi, for the nextjs sample app, QQ: - in middleware...
# sdk-react
e
hi, for the nextjs sample app, QQ: • in middleware it sets a cookie with a uuid, then puts that as an attribute on the gb instance in the server component and also the clientapp. is this uuid serving as just an example of an id attribute, or is this something that is needed by growthbook?
Copy code
GB_UUID_COOKIE
specifically ^^^
or is it maybe a way to run experiments for anonymous users?
r
Yep. It's a first-party cookie that GrowthBook uses to persist a random unique identifier (when there's no user id, e.g.) It prevents users from being re-bucketed into different A/B test variations.
e
ah, so set it if the user is not logged in, right?
or just always set it?
r
e
yes, seems like we just always set it, regardless of logged in user or not.