Buick regal GS shuts off when driving for a long time but then starts right up?

I have a 1999 regal LS. The engine would stop at random times in traffic but restart and run again. I had the car in the shop for weeks before the problem was found. I do not know the exact parts replaced but the electrical problem was in the area of the ignition switch. The car has run great for years. Louisville, KY. 40220