in reply to Digitally Signed Cookie
The (compelling!) reason for “digitally signed cookies” is a so-called session riding attack, which involves (in its various forms) the use of replayed, forged or tampered cookies. Many ill-designed systems assume that, if you present them with a “session ID” cookie that appears to be of the correct format (it could just be an MD5 string...) this ID must represent an existing or we-should-make-one-now session. Or perhaps, that user's identity. A captured token might be replayed, e.g. by a rogue script running on that user's machine, and thus gain rights it should not (still) have.
There are many cookie-validation schemes out there on CPAN now, so you don't have to create this from scratch, but the basic idea might be (for example...) this:
This scheme can be used to append other information to the cookie, such as an expiration-time. “Guard digits accompanied by a long, random, secret string” can also be used to produce masks, so that (say) the true value of a session-ID can be concealed.
Remember: in CPAN this sort of thing already exists. Cookie-validation (and POST-data validation!) should be provided at a very high level within your application framework so that these services become reliably available to every part of your application without further concern from you. (If it were something that you had to be conscious of, you'd miss something and an exploitable “hole” would be awaiting discovery. Because rogues use automatic scripts to test such things, it would be discovered.)
Don't “trust” ... verify.