How can I share variables across controllers? For example I would like to have a global “token” variable, or possibly a current_user variable that all routes can share.
Similarly I might want to save API URLs as constants for certain REST endpoints.
I guess environment variables may be used, or perhaps an object kept in the data store may retain session values for the lifetime of the application.
Any pointers or examples would be appreciated.
Thank you, Bahadir