I like both Sorrento and Salerno for different reasons.
Salerno is quieter, less touristy. Easy access to AC towns, Paestum. Too far from Capri (2+ hours each way- no thanks!). Not sure you will find a cooking class there.
Sorrento is lively, fun for walking around, shopping, eating. Easy access to Pompeii, Capri. More casual eating options than you will find in Salerno. Just a lot more going on than in Salerno.
I am pretty sure my former teenage daughter would have preferred Sorrento.
Neither town is really where I would plan a beach day. The beaches are just not that great (pebbly and small) although Salerno has a long sandy beach - I don’t think it’s the scene your girls are thinking of.
You have 6 nights and will need to stay in Naples the night before your departure flight- unless it is well past noon.
So that leaves 5 nights for wherever you choose to stay.
Honestly I think would get bored in Salerno after maybe 3 nights.
From Sorrento 5 nights- which is really just 4.5 days:
Day 1 Arrival- just wander around Sorrento, fun shopping lanes, views of Vesuvius, etc
Day 2 Visit Pompeii via Circumvesuviana- this is so easy to do. If you visit on your way to Naples you will need to store bags- unless you hire private driver $$$
Day 3 Visit Capri
Day 4 One day to see AC towns- check Mondo Guides- they have a very affordable van tour that would work for you.
Positano, Amalfi, Ravello are all only worth a few hours at most.
Or DIY ferry from Sorrento- stop in Positano- climb all the up and down, back on ferry to Amalfi- same thing. Ravello requires a crowded bus and unless you allow time to walk out to Villa Cimbrone it’s probably not necessary.
Actually doesn’t leave a day for cooking class, hiking or anything else unless you do put Pompeii on your way to Naples.
So Day 2 could be cooking class.
Sorrento is very safe. If you stay there do give the girls some independence- they can join in the fun passeggiata on the Corso, explore the shopping lanes by themselves, etc. There will be be plenty of other teens doing the same.
(Salerno is safe as well and also has a fun passeggiata)