> can smbdy tell me when do we say that a new session is started
Sessions begin depending on whether or not a session is already active. When you call session_start() a cookie is sent to the client browser. That cookie remains active until either the session times out or the user closes the browser window. So if you have a session set up correctly, refreshing will just keep the current session active, unless you refresh after the session times out, in which case a new session would be started (provided the criteria for starting a new session is met).
> how is garbage collector related to session timeout
Garbage collection depends on the setting of three ini directives,
session.gc_divisor
session.gc_maxlifetime
session.gc_probability
session.gc_divisor and session.gc_probability determine when garbage collection will happen, this can be thought of as a percentage. If the divisor is 100 (it's default value) and the probability is 1 (it's default value), then upon every request to the server, there is a 1 in 100 (1%) chance that garbage collection will execute. If you want a greater certainty of garbage collection, just increase the probability value. If you increase that number to say 80, then there is an 80% chance that garbage collection will run on every request. I assume this system is meant to conserve resources. Then of course the maxlifetime directive defines the time at which a session will be considered expired, any time after it has expired, garbage collection can come to end the session, though as I've already said, that depends on the probability directive. When the probability directive is a low value, old, expired sessions are more likely to be revived.
> how is cookie expire time related to session timeout
The session cookie is destroyed when either the session times out or the browser window is closed, depending on which happens first.
HTH!
Regards,
Rich
--
Author,
Beginning CSS: Cascading Style Sheets For Web Design
CSS Instant Results
http://www.catb.org/~esr/faqs/smart-questions.html