Baroness Tessa Jowell has become the first person to donate her medical information to a new global database.
The ex-culture secretary, who has an aggressive brain tumour, said she hoped that the Universal Cancer Databank would help develop better treatments.
She feels a "sense of responsibility" to pave the way for others, her daughter Jess Mills said.
Researchers will be able to access the anonymised data in the UCD, set up by an Australian billionaire, for free.
Baroness Jowell was diagnosed with brain cancer in May last year. She earned a minute-long standing ovation in the House of Lords in January, after making a plea for more cancer treatments to be made available through the NHS.
On Thursday, she returned to the House of Commons and watched MPs pay tribute to her bravery during a debate on cancer treatment.
Baroness Jowell said: "It is my hope that through my cancer journey and sharing of my data, we will be able to develop better treatments for cancer and speed up the discovery of new ones."
Ms Mills said her mother, who has been campaigning for better treatment for cancer patients, wanted to give a voice to others.
She said: "Her bravery, her dignity, her ferocious sense of mission, her selflessness and her courage and her vision and her ability to lead at a moment where others would quite simply withdraw.
"So we are doing this for her, with her, we are doing this for all of us."
Health minister Steve Brine said it was "vital" that patient data was shared more effectively around the world.
Andrew Forrest, an Australian philanthropist and founder of the Eliminate Cancer Initiative and the database, said Baroness Jowell's pledge was an "incredibly selfless act".
"We hadn't met, we didn't know each other, and I put the idea to her that she could be the first to step out and contribute her data, knowing that it's going to go into a global bank which will be freely accessible to researchers all over the world," he said.
"The energy in her conviction literally crackled down that phone line.
"She said: 'I'm going to do this Andrew, this is exactly what the world needs.'"
The UCD database is a project by the Eliminate Cancer Initiative and part-funded by the Minderoo Foundation.
On Thursday, Labour MP Sarah Jones, who used to work for Baroness Jowell, tabled a motion that called for greater sharing of health data and more adaptive clinical trials to improve outcomes for brain tumour patients.
She finished the debate by reading a note from Baroness Jowell, who was watching with her family from the gallery.
The note said: "Living with cancer has taught me so much.
"I've been so lucky to be surrounded by such love from family, friends and fellow cancer patients.
"So remember our battle cry - living with, not dying of cancer, for more people, for longer."
I'm so moved to have been surrounded by the love of colleagues from across Parliament today and their support to beat cancer together pic.twitter.com/TTS781IOmn— Tessa Jowell (@TessaJowell) April 19, 2018
Labour's Tulip Siddiq said Baroness Jowell was a model of resilience and optimism.
Former Northern Ireland secretary and Tory MP, James Brokenshire, who himself recently went through a procedure to remove a tumour in his lung, said "a profound message of hope" shone through her words.
Labour's Helen Hayes called Baroness Jowell "extremely brave", and Labour MP Siobhain McDonagh, fought back tears as she said: "We are with you."