def to_cookie
      unless self.empty?
        data = self.serialize
        value = Merb::Parse.escape "#{data}--#{generate_digest(data)}"
        if value.size > MAX
          msg = "Cookies have limit of 4K. Session contents: #{data.inspect}"
          Merb.logger.error!(msg)
          raise CookieOverflow, msg
        end
        value
      end
    end
def to_cookie
      unless self.empty?
        data = self.serialize
        value = Merb::Parse.escape "#{data}--#{generate_digest(data)}"
        if value.size > MAX
          msg = "Cookies have limit of 4K. Session contents: #{data.inspect}"
          Merb.logger.error!(msg)
          raise CookieOverflow, msg
        end
        value
      end
    end
Create the raw cookie string; includes an HMAC keyed message digest.

 ==== Returns
 String:: Cookie value.

 ==== Raises
 CookieOverflow:: More than 4K of data put into session.

 ==== Notes
 Session data is converted to a Hash first, since a container might
 choose to marshal it, which would make it persist
 attributes like 'needs_new_cookie', which it shouldn't.

 :api: private