The question may seem to be confusing, so let me explain, i'm building a react app that's basically about traveling and shows each cities tourist attraction by the city that the user has chosen, but the problem is all of the pages are filtered by the city name that has been chosen in header, so what i'm trying to do save the slug attribute that is unique to each city and pass it to my api call, but i want it to only show as long as the browser isn't closed, for example if user chooses the city in home page and goes to another page i should still have that slug, and i don't want to change my routes, so the option to change my routes is crossed for example like below:
www.example.com/NY
or
www.example.com/NY/tour/central park
I want to keep my routes like before but still have the slug NY
, so my routes look like below
www.example.com
or
www.example.com/tour/central park
So how can i accomplish that?