The test measures the amount of cortisol in a person’s body in sample of urine, blood or saliva. Cortisol is a hormone produced by the adrenal gland and helps in management of stress (fight or flight response) and aides other systems in the body like the digestive, reproductive and the immune system. The test is used to detect problems in the adrenal and the pituitary glands, in case of excess or insufficient production of the hormone. The level of cortisol varies throughout the day, hence a 24 hour sample in taken in case of urine and saliva, and twice a day in case of a blood sample.