Fix #1 localhost causing nil exception.
Use Rails method for finding domain. It will be more accurate if user
sets up the tld_length correctly in Rails.
Merge pull request #4 from lulalala/subdomain-fix-2

Use request.domain to get the cookie domain instead of parsing the host string.