This project is archived and is in readonly mode.
message_verifier.verify - fails when cookie doesn't contain '--'
-
Tarmo Lehtpuu
- Tag set to active_support, cookiestore, cookie_store, session
-
Jolyon
Not sure the regular expression test above is quite right. This worked for me:
cookies['_some_session_id'] && ! (cookies["_some_session_id"] =~ /--/) end -
Todd Persen
I think you want to use !~ to achieve the desired effect. Also, the redirect_to was missing the underscore. The cleaned up version should look like:
before_filter :delete_broken_cookies def delete_broken_cookies if cookies['_some_session_id'] && cookies['_some_session_id'] !~ /--/ cookies.delete '_some_session_id' redirect_to root_path and return false end end -
Wesley Moore
This is the solution I used:
def delete_broken_cookies if cookies['_Radio_session'] && !cookies['_Radio_session'].include?('--') reset_session end end -
Rohit Arondekar
- State changed from new to stale
- Importance changed from to
Marking ticket as stale. If this is still an issue please leave a comment with suggested changes, creating a patch with tests, rebasing an existing patch or just confirming the issue on a latest release or master/branches.