服务器更改的旧cookie问题

I have two servers w1 and w2. A PHP project was installed on w1 and I moved it to w2.

The project has a login function using cookies. The problem is that people that were loged in the old server still have the cookie, so the login is not working on the new server until a browser restart.

Any idea how to solve this?

You need to create new cookies on client browser on request

Check new Cookies exits in request.

No - you will get old cookies in request handle that and generate new cookies.

Yes - Just implement new login functionality based on new cookies