A
A
Aleksandr Yurchenko2019-10-12 13:03:17
phpstorm
Aleksandr Yurchenko, 2019-10-12 13:03:17

How to fix the cookie lifetime warning?

Good afternoon.
Please tell me how to fix phpStorm warning. Cookies are set as follows:

setcookie('login', $login, time() + 3600 * 24 * 7, '/');
setcookie('pass', $pass, time() + 3600 * 24 * 7, '/');

The IDE is very bad and says: PHP Consider using \DateTime for dst safe datetime manipulation , googling I found several solutions, but I honestly didn’t quite get a taste of how to adapt to my situation :(

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2019-10-12
@yaleksandr89

as in the last question: this is a warning/hint. and not from a storm, but from the php inspections ea plugin.
In this case, you can score on him.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question