Archive for June 2012

How to access Session from an IHttpHandler

I’ve gotten a lot of use during my time coding with ASP.NET out of inheriting from IHttpHandler. I usually do this to handle dynamically-generated files in various formats (PDF, XLSX, and images to name a few). One thing that always irked me was the inability to access the HttpContext’s SessionState object to get things like connection strings and information about the logged-in user more easily to aid in generating my files; often I would end up encrypting those and cramming them into the query-string, which can present challenges such as replay attacks that I’d then have to find a way to prevent.

Getting started with Amazon AWS via C#

A while back I was putting together a website that, among other things, relied on being able to retrieve products from Amazon’s Product Advertising API. There isn’t a ton of documentation out there on how to do this, and it took me a long time to find information on how to do this in my language of choice, C#. Unfortunately, there isn’t anything as cool as the Zend Framework for .NET.