I am setting up a cooking when my dashboard loads (and only when it loads, there are no concurrent cookies) - and the dashboard loads technically every-time i switch companies. The cookie sets a company id that I need in subsequent forms and that i took from setting the app.model on load.
this works, the first time… if I switch companies, the system is login me out and not changing the cookie. I added a second action to remove the cookie first and then set a new one. but that is not working either. Pretty stuck here so I really appreciate any ideas or suggestions.
This really sounds like you have actions running that you may not know about.
I would start by chasing down the actions that can run from the first event.
If that does not show clues, then start deconstructing things to break them into small parts and test one part at a time.