# module Devise::Models::Rememberable::ClassMethods

### Public Instance Methods

remember_token() click to toggle source

Generate a token checking if one does not already exist in the database.

    # File lib/devise/models/rememberable.rb, line 106
    def remember_token
      generate_token(:remember_token)
    end

serialize_from_cookie(id, remember_token) click to toggle source

Recreate the user based on the stored cookie

    # File lib/devise/models/rememberable.rb, line 100
    def serialize_from_cookie(id, remember_token)
      record = to_adapter.get(id)
      record if record && record.rememberable_value == remember_token && !record.remember_expired?
    end

serialize_into_cookie(record) click to toggle source

Create the cookie key using the record id and #remember_token

    # File lib/devise/models/rememberable.rb, line 95
    def serialize_into_cookie(record)
      [record.to_key, record.rememberable_value]
    end