Calling correct function for cookie values