rails4 support

Hi, I added support for rails4. I found I needed this when upgrading a rails3 app and one requirement was that the cookies from 3 needed to work with 4. Thought someone else might find it useful.