This is pretty much related to CGI-stuff, but then again, i'm making it with Perl, so guess that justifies writing this here :)
In standard cookie the expiry-date format is like this: "Sat, 20 Feb 2010 01:31:52 GMT". I would need to create a script that updates this timestamp with each login with 1 hour addon, so the expiry date is allways 1 hour ahead the time user last received a cookie from this script. This way i try to ensure that the problem with shared computers don't come up with login. At least it's controlled in some way, if user forgets to logout.
My question is, how should i test that timestamp and make sure of that 1 hour addon to be made correctly? Should i just test every segment of it, like if hours are now 23, make sure next is 0 and so on? I obviously have to take in consideration leap year as well. I'm sure there's nothing but tons of already made modules for this kind of date manipulation, but i cannot install those to this server, so i need to write my own handler.
I am aware how to split and read that timestamp with regex, so no problem there.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.