We present neutron scattering studies of the inter-planar correlations in the high-temperature superconductor La1.88Sr0.12CuO4 (T_c=27 K). The correlations are studied both in a magnetic field applied perpendicular to the CuO2 planes, and in zero field under different cooling conditions. We find that the effect of the magnetic field is to increase the magnetic scattering signal at all values of the out-of-plane wave vector L, indicating an overall increase of the magnetic moments. In addition, weak correlations between the copper oxide planes develop in the presence of a magnetic field. This effect is not taken into account in previous reports on the field effect of magnetic scattering, since usually only L~0 is probed. Interestingly, the results of quench-cooling the sample are similar to those obtained by applying a magnetic field. Finally, a small variation of the incommensurate peak position as a function of L provides evidence that the incommensurate signal is twinned with the dominating and sub-dominant twin displaying peaks at even or odd L, respectively.