Contact adhesive works great if the foam is clean enough. I buy the foam from my local bike shop and make 90% of my old bike filters with it, and have not had a hint of drama with them.
I've had only moderate success gluing old torn filters back together, though - the normal 'cleaned and ready to re-oil' is NOT clean enough to allow the glue to stick - generally by the time I've cleaned it thoroughly enough for the glue to stick, I've either torn the tired old filter or I've wasted so much time that I should have just made a new filter....
And beware the new 'improved' contact adhesive because it is hopeless on air-filter foam. Its white, rather than the good old tan/snot coloured stuff.