Sen. Patrick Leahy (D-Vt.) asked that representatives from Apple and Google testify before the Senate Judiciary subcommittee on privacy May 10.

The subcommittee called the hearing after researchers Pete Warden and Alasdair Allen published a report revealing that a file on the iPhone stores time-stamped location data.

Google has separately said it also collects anonymous tracking data for its location services, which users can turn off.

In letters to Apple CEO Steve Jobs and Google CEO Larry Page, the Judiciary Committee chairman said that consumers deserve to know how new technology affects their privacy and security.

On Wednesday, Apple addressed accusations that the iPhone is tracking users, saying the file uncovered by researchers is part of a larger database used for location services. The company said a bug in its operating system software has kept the data for longer than it intended — in some cases, up to a year.

Apple said that in the next few weeks the company will issue a software update that allows users to delete the cache by turning off location services. The update will also stop backing up the file on users’ computers, and reduce how much data is stored on the phone.

It will also better protect the file by encrypting it, Apple said.

Sen. Al Franken (D-Minn.), who chairs the subcommittee on privacy, sent a letter to Jobs about the file last week and invited Apple and Google to explain their policies on mobile privacy.

Related stories:

Apple blames bug for location data file, plans policy changes

How to encrypt the iPhone tracking file

Your iPhone and iPad are tracking you, researchers say

Tracking on the iPhone catches the Hill’s attention