Setting Cookies IP vs Domain Name

Syran

Golden Member
Dec 4, 2000
1,493
0
76
I have an internal employee website I run for my company on the side. During a recent crash, I decided to move to Gentoo vs the old Redhat 7 disto the last machine was running on. I have no come across a strange problem.

Before the change, I had everything staticly set at 10.1.1.19; after the chance, sometimes, it switches from 10.1.1.19 to employee.domain.local. When this happens, it can't find a cookie registered under 10.1.1.19, and requires users to log in again. Each time it switches to a page with a required login, that is different from the last domain, it requires a log in again.

Is there any way to tell it that 10.1.1.19 and employee.domain.local are the same thing, and to look at the same cookie, instead of creating 2 cookies with differing session id's?
 

MrChad

Lifer
Aug 22, 2001
13,507
3
81
No.

Cookie security is built the way it is for a reason. A site can only read from cookie of its own domain or subdomain. employee.domain.local can read cookies set from employee.domain.local or domain.local.

My suggestion is to enforce some sort of policy that forces your users to use a particular domain (i.e. have your login page automatically redirect to a employee.domain.local). That will save you a lot of headaches down the road.