I make four 3/8" x 2" x whatever" hardwood pieces - I don't know what to call them. I fit these down flush into where the leg and rail meet. I glue and screw them in place. They each extend about 3" out either side of the leg / rail.
I then simply screw, through an oversized hole, up into the bench top with a couple of stout screws / lag bolts, two at each location.
I've done this on two benches and I haven't run into any issues.
Mark