It depends on the container, but the sessions have little to do with GC. For example, tomcat keeps active sessions in memory and saves them to disk. Swapping the active sessions in memory out with inactive (or idle) sessions as needed. This way the sessions survive even when the server is restarted.
Check this out for more info: http://tomcat.apache.org/tomcat-6.0-doc/config/manager.html#Introduction