I've always used duct seal, which comes in a block and is usually black in color. I've softened it in hot water to make it more pliable if the weather was cool. I just form a rope of it perhaps 3/8" in diameter and press it in the recessed opening for the woofer. before pressing the woofer in and inserting the screws.
Whether or not this is the proper way of sealing the woofer I don't know. But, it's always worked for me. I might add that when I remove the woofer initially I always clean off all the old sealer from both the baffle and the driver.