A website developed by asp.net mvc to automatically locate cities based on IP addresses

website is developed by asp.net mvc
when opened, locate the current city based on the customer"s IP address, and then switch to the content of the corresponding city (switch cookie)
now the city is judged by ip in baseController, and then switch the cookie, display content directly.

question:
IP is switched automatically in baseController. In this case, you can"t switch cities manually, which means I can"t open the Shanghai page in Beijing.

seek ideas

Apr.23,2021

baseController check whether cookie exists. If it exists, it won't move. Add one if it doesn't exist.

when switching manually, change cookie .

Menu