I have used every thing from rear view mirror adhesive, to epoxy. Certainly most strong adhesives will work.
When it is stuck, I use a very small pry bar, very gently--to start the window moving back.
Also key is keeping the channel the window slides in clean and well lubricated with a dry silicone compound such as Liquid Rollers by Mary Kate. 3M makes the dry silicone, as do many other lubricant manufactures. Don't put any grease in the slot, it will attract material which eventually will impede the sliding windows movement.