A study of the absorption systems toward the gravitationally lensed quasar APM 08279+5255 is presented . Most of the Mg ii systems in the redshift range z \sim 1.2–2.07 , although saturated , show large residuals at the bottom of the lines . The most likely interpretation is that individual clouds within Mg ii halos do cover only one of the two brightest QSO images . The separation between the two lines of sight decreases from 1.7 to 0.7 h ^ { -1 } _ { 75 } kpc ( q _ { o } = 0.5 , z _ { lens } = 1 ) between z = 1.22 and z = 2.07 . This reveals that Mg ii halos are made of a collection of clouds of radius smaller than about 1 h ^ { -1 } _ { 75 } kpc . Two strong Mg ii absorbers at z _ { abs } = 1.062 and 1.181 are studied in detail . This is the first time that the Na i \lambda 3303 doublet is detected in such high redshift systems . Together with the detection of the Mg i \lambda 2852 transition , this strongly constrains the physical characteristics of the gas . The N ( Na i ) / N ( Mg i ) ratio is found to be larger than unity , implying that the gas is cool and neutral . The Doppler parameters measured in individual and well detached components is probably as small as 1 km s ^ { -1 } . The column densities of Na i , Ca ii , Mg i , Ti ii , Mn ii and Fe ii observed at z _ { abs } = 1.1801 are very close to that observed along the line of sight towards 23 Ori in our Galaxy . The shape of the QSO continuum is consistent with attenuation by dust at z \sim 1 ( A _ { V } \sim 0.5 mag ) . Altogether it is found that the H i column density at z = 1 is of the order of 1 to 5 10 ^ { 21 } cm ^ { -2 } , the corresponding metallicity is in the range 1–0.3 Z _ { \odot } , the overall dust-to-metal ratio is about half that in our Galaxy and the relative depletion of iron , titanium , manganese and calcium is similar to what is observed in cool gas in the disk of our Galaxy . The objects associated with these two systems could both contribute to the lens together with another possible strong system at z _ { abs } = 1.1727 and the strong Lyman- \alpha system at z _ { abs } = 2.974 . The probable damped Lyman- \alpha system at z _ { abs } = 2.974 has 19.8 < log N ( H i ) < 20.3 . The transverse dimension of the absorber is larger than 200 h ^ { -1 } _ { 75 } pc . Column densities of Al ii , Fe ii , Si ii , C ii and O i indicate abundances relative to solar of - 2.31 , - 2.26 , - 2.10 , - 2.35 and - 2.37 for , respectively , Fe , Al , Si , C and O ( for log N ( H i ) = 20.3 ) . These surprizingly similar values indicate that the amount of dust in the cloud is very small as are any deviations from relative solar abundances . It seems likely that the upper limits found for the zinc metallicity of several damped Lyman- \alpha systems at z > 3 in previous surveys is indicative of a true cosmological evolution of the metallicity in individual systems .