Is it possible (if it is, how hard is it to) create a fake cookie to someones website.
As in, if my cookie saves a user name and the when the cookie is found it logs in that user by the cookies user name. I don't want anyone to be able to create a fake cookie file on their computer with my sites information and someones username and allow them to login. Does that make sense?
If that is possible what is a way around that to make cookies safer?
I was thinking maybe when the user logs in, it saves a cookie with a generated ID and saves the ID in the database then when the cookie is found is logs the user in based on the ID. That was even if someone could create a fake cookie they still wouldn't know the randonly generated ID used to access the users information. I think that would work but I don't wanna go through the extra trouble if the cookie is already safe?