A security guard told an RFE/RL correspondent filming the incident that Solida Movlayeva and an employee of the Baku-based Institute for Security and Freedom of Reporters were detained "to clarify the issue."
Movlayeva later told RFE/RL that she was told her YAP membership card will be returned to YAP Executive Secretary Ali Ahmadov.
Movlayeva, who is a secondary school teacher, announced during her son's trial in Ganca that she would quit the YAP.
Azerbaijani public-sector employees, including teachers and doctors, are under pressure to join the YAP.
Haciyev, who is 29 and a Harvard graduate, was jailed last month for two years for evading military service.
He ran unsuccessfully in the November 2010 parliamentary election.
The YAP won an overwhelming majority of seats in the election, which international observers and monitoring groups said was marred by numerous procedural irregularities.
Read more in Azeri and watch a video here