The end result is the same, too. Current medical advice is a mix of sleep hygiene and meditation strategies (some insomniacs feel extremely anxious when they can't sleep, which makes things worse) and medication.
I'm currently not taking medication, but for many years it was a pretty constant cycle 6-9 months on medication, and then a few months tapering off because my body would quickly build tolerance to them. Medication was pretty critical when I was in college, but in the decade since I've graduated I think I've just come to see the cycle as unsustainable and ultimately kind of pointless which is why I haven't taken them for about a year now.
I've tried pretty much everything. Of course Melatonin and Benadryl don't work much. Klonopin and Ambien both work well, but I try not to use it more than 1x a week to avoid a tolerance.
No pills ever worked for my insomnia but hydroxyzine made me much more comfortable while trying to sleep.