Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do cookies expire on server IP change?

Tags:

php

cookies

I am going to change the server of my website and SQL server will move to new server too. The url (Domain Name) wont change but the IP will change.

Does members who have previously logged in will log out? I use Cookies to keep users signed in.

If the cookies expires, how can I perform this task? I am using PHP to set cookies for users.

like image 248
Ali Sheikhpour Avatar asked Mar 07 '23 04:03

Ali Sheikhpour


1 Answers

Cookies are associated with hostnames, not IP addresses.

The browser won't expire them just because the domain moves. That would break a lot of load balancing systems!


If the cookie relates to information on the server (e.g. a session id) and that data doesn't get transferred to the new server, then the connection will be lost though.

like image 141
Quentin Avatar answered Mar 11 '23 21:03

Quentin