def attr(self, attr_name, attr_value=None):
		""" Return attribute value. Attribute value can be updated with this method. In order to update
		attribute value attr_value must be set. Cookie attribute value couldn't be changed if cookie is
		in read-only mode (RuntimeError exception is raised).

		:param attr_name: target attribute name
		:param attr_value: new value to set
		:return: str
		"""
		name = self.__attr_name(attr_name)
		if attr_value is not None:
			if WHTTPCookie.cookie_attr_value_check(name, attr_value) is not True:
				raise ValueError('Unacceptable value passed')
			if self.__ro_flag:
				raise RuntimeError('Read-only cookie changing attempt')
			self.__attrs[name] = attr_value
			return attr_value
		return self.__attrs[name]