First you should stop using the lawn mower immediately. Second, if you are somewhat of a handy person, unplugged the mower from the wall outlet and remove the casing where the cord goes into. Try using electrical tape or fasten with a clamp to prevent it from pulling out.
I assume you mean that the cord comes loose while you are cutting the lawn, and the mower stops. I solved this by wrapping the cord around the handle a couple of times. The occasional tugs on the power cord as you mow then don't pull on the plug.