darya/framework

Automatic strtotime() when setting cookie expiration

hexus opened this issue · 1 comments

hexus commented
$response->cookies->set('key', 'value', strtotime('+1 day', time()));

This could be improved by adding a check for string expiration arguments, and if it is a string, using strtotime to automatically convert it to a timestamp.

$response->cookies->set('key', 'value', '1 day');

Doesn't that look much better?

hexus commented

Added some handy methods and the ability to retrieve different properties of cookies. Tests can be expanded upon some time.