rack/rack — Issue #299: Unmatched Session Secret Error
Author: mutewinter
Created: 2011-12-30 19:03:13+00:00
State: open

Upon switching to Rack 1.4.0 I get the following error when the session secret doesn't match a user's already generated cookie.

```
TypeError at /
can't convert nil into String
file: cookie.rb location: hexdigest line: 152
```

The error is caused when the browser's cookie was generated with a different session secret. The error appears to have been introduced in [this commit](https://github.com/rack/rack/commit/691b5d3fd8ea60e5922ab8cf1ea15810d50d28db#lib/rack/session/cookie.rb).

This problem will be run into anyone who is using Sintra's `enable :sessions` feature, which generates a new session secret every time the app runs.