@sunscreem A session variable seems the right place for me if you’re wanting to manipulate the data for a user. The active month value should be cleared when the user clears their session. Are you not seeing this behavior? Or have I misunderstood what you’re trying to achieve?
Should I be using a session variable here?
Several views and controllers in my app need to know the "$activeMonth" that a user is processing.
By default, on login, the $activemonth var is just set to the current month. I actually just set it to a Carbon instance with the 1st of this current month.
The user can change the $activeMonth in my app. (Ie... the click "next month")
How do I share this $activeMonth "global" with all the views and controllers in my app?
I've got it working by setting it to a session variable but that seems clunky, and is having some odd results when I manipulate the dates. Also the variable doesn't get reset when the user refreshed their browser window which is a behaviour I would like - Ie ideally the $activeMonth should only persist until the user logs out/refreshes the browser.
I feel like I'm missing a more obvious what to do this?
Please or to participate in this conversation.