News Feed
Sections




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

Joseph Scott:
Stateless CSRF Tokens
August 02, 2013 @ 11:16:44

Joseph Scott has a recent post to his site looking at the idea of stateless CSRF tokens and how to create them while avoiding the typical "store them in a session" mentality.

This is all fine and good until you want to avoid using PHP sessions. Perhaps you have several web servers and don't want to deal with shared session storage. Or have servers in multiple data centers and don't want to try and sync state across them. What ever the reason, popping a token into $_SESSION isn't an option in this case. In short you want some sort of stateless CSRF token.

He looks at two methods to help get around this issue. The first method is based on known values that won't change very frequently (say, maybe 24 hours). His second method, however, has a bit more strength to it. His idea uses a combination of a key, the current time, a timeout and a known string of data - all base64 encoded.

0 comments voice your opinion now!
csrf token stateless tutorial session base64 timeout microtime

Link: https://josephscott.org/archives/2013/07/stateless-csrf-tokens

blog comments powered by Disqus

Similar Posts

Brian Swan's Blog: Consuming SQL Azure Data with the OData SDK for PHP

Mikko Koppanen's Blog: Color analysis

Zend Developer Zone: Tutorial : Using Zend Framework Without PDO

SitePoint PHP Blog: Mangling XML as Text with PHP DOM

Hasin Hayder's Blog: Counting occurrence of a word in a String - Benchmarking of PHP functions


Community Events





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


list opinion framework release refactor podcast symfony2 testing interview community introduction threedevsandamaybe install laravel api unittest developer code series language

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