E
E
ex3xeng2015-11-22 17:22:25
PHP
ex3xeng, 2015-11-22 17:22:25

How can I check if a file is on my server?

Good afternoon! There is such an idea, after the user's authorization on the site, save his name and photo in cookies, after the session expires, when he is redirected to authorization, do not display the entire form for him, but offer to enter only a password, such as:
Hello John! {PHOTO}, so the point is that saving the data is not a problem) the problem is that in the photo cookie I want to keep the path to the picture and the question arises if the cookie is suddenly replaced ..
my cookie: /files/photo/user/1 /photo.jpg
villain cookie: zlo.ru/zloi-kod.js
and it turns out that the wrong code will load, how to avoid this situation?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2015-11-22
@Rsa97

Keep a random uid in the cookie, and everything else in the database, tied to this value.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question