If you mean static variables, they should certainly keep a value for the life of the
servlet. Servicing individual requests should not use any static or instance variables to store information specific to a given request.
Opening/closing browser windows had nothing to do with initializing the servlet - but could affect cookies that the servlet would recognize.
The lifetime of a session depends on settings in the servlet engine. 30 minutes seems to be a common lifetime.