I've noticed that ghasts won't shoot fireballs if you are COMPLETELY encased in glass, but if there is one hole, they will blast all your glass to smithereens.
Also, spiders and other mobs can see you without glass--I don't think glass makes a difference. If you are inside they will go above you and wait you out--when you walk outside they will follow you and fall on you from above.
They are so persistant about this that I usually build a trap--a hole in the roof with a little room lined with cactus and a glass floor. When I hear a bad critter at night I walk under the glass floor of the little room. They follow me and jump into the room (pit--which is over my head). I walk away so that they rub up against a cactus until they die.
It's a manual process but 100% safe.
btw, creepers will fall down there but probably won't die, they like to hide between the cacti and not move until they can actually get to you--but at least they are out of the way.