News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Evert Pot's Blog:
Storing encrypted session information in a cookie
July 14, 2010 @ 09:13:39

Evert Pot has a quick new post to his blog today talking about how to push encrypted information into a cookie for storage.

There have been a couple of approaches I've been considering [to replace sessions being stored in the database], one of which is simply storing all the information in a browser cookie. First I want to make clear I don't necessarily condone this. The reason I'm writing this post, is because I'm hoping for some more community feedback. Is this a really bad idea? I would love to know.

He includes some code to make it happen - a class that uses the hash_hmac function and a SHA1 encryption type (along with a salt) to convert the information into a string that can be (relatively) safely stored in a cookie. Be sure to read the comments for more opinions on the method.

0 comments voice your opinion now!
store encrypt session cookie tutorial


blog comments powered by Disqus

Similar Posts

Slawek Lukasiewicz's Blog: Working with date and time in object oriented way

SitePoint PHP Blog: Building an Ad Manager in Symfony 2

Ibuildings techPortal: Everything you always wanted to know about UTF-8 (but never dared to ask)

NETTUTS.com: CodeIgniter From Scratch: Day 2

Oracle Technology Network: Installing PHP 5.2 for Oracle on Mac OS X 10.5 (Leopard)


Community Events

Don't see your event here?
Let us know!


conference voicesoftheelephpant php7 introduction community api framework configure podcast opinion language application release interview symfony2 laravel library example performance series

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework