Forum Discussion

PerBonomi's avatar
9 years ago

http request session times out

Hi everyone.

My situation:

  • I have a custom component in every forum reply.
  • That component can only show up for users with a certain role.
  • I don't want to call the API every time the component loads (say, 20 replies per page). I don't need to, since the variable only pertains to the logged in user, not the individual posts.
  • I want to check the current user's roles once on page load, store a variable and read that variable within my component
  • Currently I'm running a macro on page init that checks the user's roles and does http.request.setAttribute("role","true")
  • My component, when loaded, just does http.request.attributes.name.get("role","false") and this way I'm not forcing 20 api calls.

 

The problem is that after a while this "session variable" times out, even though the user is still logged in. This forces my users to have to log out and in again, for the variable to be re-set.

 

What am I doing wrong?

No RepliesBe the first to reply