protected static function parse($value)
    {
        $segments = explode('+', $value);

        // check if the cookie is invalid.
        if (!(count($segments) >= 2)) {
            return null;
        }

        $value = implode('+', array_slice($segments, 1));

        // check the SHA-1 hash from the cookie.
        if ($segments[0] == static::hash($value)) {
            return $value;
        }

        return null;
    }