Re: sessions and trans-sid problem/question
| From: | Jean-Christian Imbeault | Date: | Fri, 22 Nov 2002 08:08:43 +0000 |
| Subject: | Re: sessions and trans-sid problem/question | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125568@lists.php.net to get a copy of this message | ||
Justin French wrote:
PHP cannot possibly know when a user closes a window... PHP regularly "cleans out the garbage" of old abandoned sessions, but you cannot expect this instantly...True ... but the browser does. I think I would not have this problem using cookies since the cookie would expire after the browser is closed. The reason I am seeing this problem is that I am passing the SID in the URL and hence PHP does not know that the browser was closed.
If you access that URL tomorrow, I doubt the session will STILL be valid...True. I guess I should set the gc to clean up sessions more often than it does now. Maybe 30 minutes ...
You should do some reading up in the manual & php.ini, making sure what session destroy means, what session.auto_start means, etc.I know what they mean. I got very confused until you pointed a very obvious thing out. It's passing the SID in the URL that is causing the problem and as you pointed out there is no work-around. I'll just have to live with the fact that by passing the SID in the URL the session will be alive until the session gc cleans up. Thanks, Jc PS If I got any of this wrong please let me know.