README.md in rack-session-smart_cookie-0.1.1 vs README.md in rack-session-smart_cookie-0.1.2
- old
+ new
@@ -41,14 +41,14 @@
"coder" class. This allows the various cookie components to be either both
serialized and stringified (in the case of the session payload) or merely
stringified (in the case of the digest).
The other key realization is that the method Rack uses to escape cookie data
-([URI.encode_www_form_component][5]) will only ever allow URL-safe Base64 plus
-period (`.`) and asterisk (`*`), so there's no sense in using any
-stringification scheme other than URL-safe Base64! It doesn't need to be
-configurable. The serializer remains configurable as the `:coder`.
+([URI.encode_www_form_component][5]) will only ever allow non-padded, URL-safe
+Base64 plus period (`.`) and asterisk (`*`), so there's no sense in using any
+stringification scheme other than non-padded, URL-safe Base64! It doesn't need
+to be configurable. The serializer remains configurable as the `:coder`.
The remaining differences are mostly just better defaults: MessagePack and
SHA2.
## Installation
@@ -75,21 +75,25 @@
```ruby
use Rack::Session::SmartCookie
```
-Rack::Session::SmartCookie accepts the same options as
-[Rack::Session::Cookie][6]. If you choose to override the default `:coder`, it
-should *not* perform the Base64 steps.
+Rack::Session::SmartCookie is a sub-class of [Rack::Session::Cookie][6] and
+accepts all the same options. If you choose to override the default `:coder`,
+it should *not* perform Base64 encoding or decoding.
-You can easily register additional custom types on the default coder's factory:
+The default `:coder` registers Symbol as a custom type on the factory. You can
+easily register additional custom types like so:
```ruby
-my_coder = Rack::Session::SmartCookie::MessagePack.new
-my_coder.factory.register_type(0x00, MyCustomType) # 0x60..0xFF are reserved
+my_coder = Rack::Session::SmartCookie::MessagePack.new do |factory|
+ factory.register_type(0x00, MyCustomType) # 0x60..0xFF are reserved
+end
use Rack::Session::SmartCookie, :coder=>my_coder
```
+
+Please see the [MessagePack][3] documentation for more details.
## Comparisons
For general size and performance benchmarks of the encoding schemes, see
[here][1]. Unfortunately, the post is slightly out-of-date and doesn't include