-
-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create lifetime cookie returns a error #2968
Comments
@lukasbestle any idea how this is even possible? Looking at the cookie code, I have no idea how the lifetime can become a float. |
@bastianallgeier This issue caused from following line:
I think, it should be like that:
Note: @texnixe has already found the source of the issue on the forum 😅 |
Is this the End of the Unix Timestamp in 2038 (Y2K38)? I think the robots will take over the world anyway, so why don't we put it on that date? 🤯 |
I think it should be this so we can keep the nice 9999-31-12 date on 64-bit machines: $options['lifetime'] = min(253402214400, PHP_INT_MAX); // 9999-12-31 if supported (lower on 32-bit servers) |
@afbora @lukasbestle I have tested both methods on a 32 bit system and both work. It is up to you which solution seems to be the better one. @lukasbestle very elegant solution for both cases! |
🤣 |
Let's hope there aren't any 32-bit servers by 2038. 😅 |
@lukasbestle wait! You live in Germany too, right? You really believe there won't be any 32-bit severs by 2038? |
I guess there will be no need for this 😄 Because Linux 5.10 solves the year 2038 problem till year 2486 Source: https://www.phoronix.com/scan.php?page=news_item&px=XFS-Linux-5.10 Related PR: https://lore.kernel.org/lkml/20201014205059.GD9837@magnolia/ |
New name suggestions, maybe better words for forever Cookie::untilCollapse(string $key, string $value, array $options = [ ]): bool
Cookie::untilTheEndOfTheWorld(string $key, string $value, array $options = [ ]): bool
Cookie::asLongAsYourOperatingSystemRuns(string $key, string $value, array $options = [ ]): bool |
Improves `Cookie::forever()` method for 32-bit servers #2968
✅ |
I have made a Cookie consent solution by my own with Kirby Cookies. However, when I use this:
It works on localhost, but not on the hosting for the customer (Host Europe), I get this error:
But this works.
As reference, please check this thread at the forum. Is there a way to avoid this? Not sure if this is a bug or only a slow hosting problem. However, if I use the forever function, the site will not work.
https://forum.getkirby.com/t/create-lifetime-cookie-fails/20228/4
The text was updated successfully, but these errors were encountered: