Applying gauss' law to planar symmetry, finding E question

mr_coffee
I'm looking at how you find E in a Nonconducting sheet. It all makes sense until the last part. Visualize a thin, infinite, nonconducting heet with a uniform positive surface charge density $$\delta$$. A sheet of thin plastic wrap, uniformily charged on one side, can serve as a simple model. Let us find the electric field E a distance r in front of the sheet.
So they ended up using a closed cylinder with ened caps of area A, arranged to pierece the sheet perpendicularly. I know that the E field is going to hit the two end caps. So your going to have 2 EA's. But if you find the flux through the opposite end wouldn't it be E cos(180) A = -EA. then the other side would be E cos(0)A = EA, so wouldn't the EA's cancel out? The book shows them both being positive:

Eo(EA + EA) = $$\delta$$A.
E = $$\delta$$/(2Eo).

Thanks.

A Gaussian surface has an inside and an outside. The direction of the surface area is always chosen to point to the outside. And the flux through an element of the surface is $\vec{E} \cdot \vec{A}$, the vector "dot product" of the field and the area. If the E field points towards the outside of the surface, the flux is positive; if towards the inside, it's negative. (In this example the field points outside on both ends.)