Re: php session GC error




"Shawn McKenzie" <nospam@xxxxxxxxxxxxx> wrote in message
news:E3.00.25553.8560D694@xxxxxxxxxxxxxxx
Frank Stanovcak wrote:
"Nathan Rixham" <nrixham@xxxxxxxxx> wrote in message
news:496D03D3.2060607@xxxxxxxxxxxx
Frank Stanovcak wrote:
"Shawn McKenzie" <nospam@xxxxxxxxxxxxx> wrote in message
news:F8.EF.24097.E510D694@xxxxxxxxxxxxxxx
Frank Stanovcak wrote:
I'm trying to make sure that my sessions are timed out by my server.
I'm running it on winxp, and my php.ini contains the following

session.gc_probability = 1
session.gc_divisor = 1

; After this number of seconds, stored data will be seen as 'garbage'
and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 30

I am now getting this error

PHP Notice: session_start() [function.session-start]:
ps_files_cleanup_dir:
opendir(C:\WINDOWS\TEMP\) failed: No such file or directory (2) in
C:\Inetpub\wwwroot\Envelope1\edit\EditMain.php on line 2

What do I have to do to make this work right?

Frank


Does C:\WINDOWS\TEMP\ exist?

--
Thanks!
-Shawn
http://www.spidean.com
Yes it does, well C:\Windows\Temp does, but win isn't case
sensitive...does it matter to PHP?
try changing it to the correct case then come back and tell us if case
matters? :)
ok...let me try it like this.

how do I explicitly tell PHP in the ini what directory to use for session
storage and cleanup. I've been googling for about an hour now, and am
just
getting more frustrated. :(

The server is a single purpose server, and it will remain that way, so I
don't want to have to code ini settings into each page. :)

Frank


Should be session.save_path, but check phpinfo() to see what it's using.
Should be the path in the error.

--
Thanks!
-Shawn
http://www.spidean.com

So if my ini looks like the following I should be able to get rid of any
session data after a preset timelimit?

session.save_path = "C:\temp"

; Whether to use cookies.
session.use_cookies = 1

;session.cookie_secure =

; This option enables administrators to make their users invulnerable to
; attacks which involve passing session ids in URLs; defaults to 0.
; session.use_only_cookies = 1

; Name of the session (used as cookie name).
session.name = PHPSESSID

; Initialize session on request startup.
session.auto_start = 0

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0

; The path for which the cookie is valid.
session.cookie_path = /

; The domain for which the cookie is valid.
session.cookie_domain =

; Whether or not to add the httpOnly flag to the cookie, which makes it
inaccessible to browser scripting languages such as JavaScript.
session.cookie_httponly =

; Handler used to serialize data. php is the standard serializer of PHP.
session.serialize_handler = php

; Define the probability that the 'garbage collection' process is started
; on every session initialization.
; The probability is calculated by using gc_probability/gc_divisor,
; e.g. 1/100 means there is a 1% chance that the GC process starts
; on each request.

session.gc_probability = 1
session.gc_divisor = 1

; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 30


.



Relevant Pages

  • Re: Sessions
    ... click the link and in aoltest3.php the session variable is visable. ... Registered serializer handlers php php_binary wddx ... session.name PHPSESSID PHPSESSID ... see the PHPSESSID, in a cookie, or in the URL. ...
    (comp.lang.php)
  • Strange difference when cookie disappears from $_REQUEST in HTTP vs. WAP
    ... with how PHP interacts with MySQL, ... Header has been generated to destroy your login session cookie, ... the cookie so it doesn't show up in $_REQUEST. ...
    (comp.lang.php)
  • Re: Is it safe to store user_id in Session?
    ... What I was wondering is how safe it is to store user_id or username or ... session so I do not need to search the database all the time. ... OVERRIDING BASIC SESSION COOKIE AUTHENTICATION ... So what is described in the article only works for bad php scripts. ...
    (comp.lang.php)
  • Re: Cookie not conserved across jump
    ... instruction in PHP. ... just leads to another HTTP request. ... $_SESSION is stocked up with the bits // the v2 page will need ... Why would session_startgenerate a new cookie at all? ...
    (comp.lang.php)
  • Re: Sessions vs Cookies
    ... There is a session cookie which simply allows the server to identify the client and retrieve relevant session data for it. ... If cookies can be read or forged, it makes little odds whether you have the master key or all the little keys,. ... Suppose you only send the PHPSESSID: Now you cannot change a thing on the server, even if you have the 'master key'. ...
    (comp.lang.php)