RE: [PHP-WIN] RE: Sessions - Bug?

From: Date: Wed, 30 Aug 2000 01:04:28 +0000
Subject: RE: [PHP-WIN] RE: Sessions - Bug?
Groups: php.windows 
Request: Send a blank email to php-windows+get-2278@lists.php.net to get a copy of this message
---------------------------------------------------------------------------- ----------------- Disclaimer: The information contained in this email is intended only for the use of the person(s) to whom it is addressed and may be confidential or contain legally privileged information. If you are not the intended recipient you are hereby notified that any perusal, use, distribution, copying or disclosure is strictly prohibited. If you have received this email in error please immediately advise us by return email at postmaster@normandy.com.au and delete the email document without making a copy. ---------------------------------------------------------------------------- ----------------- The cookie path and domain are url issues that tell the CLIENT what sites to make the cookie valid for session.cookie_path = / ; the path the cookie is valid for session.cookie_domain = ; the domain the cookie is valid for If you check out the Netscape site http://www.netscape.com/newsref/std/cookie_spec.html It tells us that the domain is which domains (as in mydomain.com.au) your cookie is valid for. If you skip it everyone in the world can request your cookie. The Path is more specific, it set the URL path. So with these two settings you can make you seesion id cookie only available for any server on mydomain.com.au and from the /login/ directory down. As such shouldnt be a problem if left alone, but i would at least set you domain to be your domain. Also specifically setting your save_path shouldnt be a problem as this works fine for me under windows and unix. There may be problem however with using c:\tmp rather than /tmp (i saw that one somewhere) As far as deleting files you shouldnt care as the PHP Garbage Collection should do the job for you session.gc_probability = 1 ; procentual probability that the ; 'garbage collection' process is started ; on every session initialization session.gc_maxlifetime = 1440 ; after this number of seconds, stored ; data will be seen as 'garbage' and ; cleaned up by the gc process So if a session is 24 minutes old (i understand this to mean not used in 24 min) the next time someone hits a session PHP will clean up the session files with the probability set (1 = 100% i think) As far as timing people out this is set with the cookie life time; session.cookie_lifetime = 0 ; lifetime in seconds of cookie ; or if 0, until browser is restarted I hope this helps. If you are using cookies you should look at the cookie spec's to get a good idea of how they work and the possibilites. ie: By setting the domain correctly and using a DB session you could share sessions across servers. mn -----Original Message----- From: Andy Hoffman [mailto:andy.hoffman@bms.com] Sent: Tuesday, August 29, 2000 9:37 PM To: James Duncan Cc: php-windows@lists.php.net; Nold, Mark Subject: Re: [PHP-WIN] RE: Sessions - Bug? James Duncan wrote: > session.save_path = c:\session\ > > So what should I set the following to? > > session.cookie_path = ? > session.cookie_domain = ? > > Any other settings that could affect my sessions not working properly? Unfortunately, I haven't used sessions myself, so I'm no authority here :( Hey, like I'm an authority anywhere else? (that's a laugh). Mark, would you have any thoughts on these settings? I recall someone else recently mentioning that *specifically* setting the session.save_path to a directory was causing them a problem, and that the problem was resolved when they let php save the sessions to its default directory (%TEMP% I do believe). Have you tried removing the directory name from the session.save_path line in your php.ini? -- Andy Hoffman Web Developer Bristol-Myers Squibb email: andy.hoffman@bms.com

« previous php.windows (#2278) next »