well, i thought this was my case before.. but i also thought that when browser is closed the session infos ON THE SERVER is also destroyed. apparently this isnt the case
You are absolutely right. When I said...
the session can still be persisted. As far as the server is concerned, a session can only timeout
I was explaining what you found via experiment. As far as the security concerns presented by this scenario, unless your browser has some way (like typing in url?sid={the-old-session-id}) of resending the session id, that session, as far as that browser instance is concerned, is effectively dead. It is only dead on the Web server, however, when the session lifetime value is up. In other words, the Web server and your browser have no communication for the duration of the session lifetime value.
Now, if some malicious website admin or spyware originator were to peak at his or her logs and discover the http header referrer information your browser sent. And, let's say, because of session fixation, he or she sees your session id affixed, they could effectively take over your session. The web server does not care about the originating IP address, it only keeps state via the session id. Also, there is the less probable man-in-the-middle concern about your session id being sniffed. Bad stuff!
So if anyone is concerned about these scenarios, use SSL and never link off to untrusted Websites in your secured Web pages, and/or force PHP to use cookies only (which may have inconvienent ramifications for some.) SSL is the only method to truely secure your sensitive data though.
My ip method is an attempt to make session logins more secure. This has to be enveloped in a function or class being that PHP session handling does not incorporate ip checks. I couldn't just grab the first ip because there are proxy farms (like AOL.) If you are behind one of the proxy farms, this means that when your browser connects to an html page, numerous proxy servers may download each individual image, stylesheet, script, etc. Thus, you end up with multiple ips. This means only one of those proxy servers will be authentic as far as your programming goes. That's when I came up with the idea for doing a WHOIS query on the block. This, of course, follows the assumption, that proxy farms are at least from the same network block.
If you want me to show some code examples and other other ideas on securing non-SSL logins. I can continue be boring. 😃