The U.S. White House and National Security Agency websites have been quietly snooping on visitors.

An excerpt from the BBC story:

Federal rules do allow government agencies to use session cookies that exist only as long as a visit to a particular website. Many online stores use them to remember the contents of a visitor's virtual shopping trolley.

However, persistent cookies that are never deleted are prohibited following guidelines first issued in 2000 and subsequently updated in 2003 by the White House's Office of Management and Budget.

The persistent cookies used by the NSA expire in 2035.

A spokesman for the NSA said a software upgrade had inadvertently left it using persistent cookies. It has now stopped using this sort of text file.

At the same time the White House website was found to be using a combination of cookies and tiny image files known as web bugs to track users.

The combination of cookies and web bugs are typically used to identify repeat visitors or track them as they move around the net.

Web bugs are not specifically prohibited by the rules on monitoring visitors to official websites.