Hello, I have added a feature into my website thr...
# ask-questions
g
Hello, I have added a feature into my website through Growthbook, but the feature flag returned values based on page refresh. I want it to be done using a kind of session or something similar. Would highly appreciate some help on here as I am new to this.
p
Hello, I am not part of the Growthbook team, but you might wanna look into sending a unique attribute to Growthbook. This can be User ID (if user is logged in) or some temporary ID that persists between requests (like generating a Session ID and sending it to the user in a cookie, then sending this Session ID to Growthbook via Attributes). Then you bind this attribute to rollout on a rule, and yo are good to go. If you want a different attribute, you can create custom attributes in
SDK Configuration -> Attributes
and creating a unique one
g
Thank you @purple-intern-56490 let me check on this
f
I'm not sure I understand the question well enough- you want to cache the feature flag payload for longer than a page refresh?
p
@fresh-football-47124 Their problem - from my understanding - is that the feature flags returning different values on each page refresh
g
I'm not sure I understand the question well enough- you want to cache the feature flag payload for longer than a page refresh?
I want to retain the flag for the current session of the user and just not on the page refresh