PHP script called by ajax can't execute start_session() -
i have script calls session_start() @ top , creates session variables. script makes ajax call invokes script b:
$("#gallerycontent").load("b.php", {op : 'get_thumbs' }, function() { $('.gallerythumb').draggable(thumb_dragops); } s);
b needs access session variables script set session_start() try @ variables. b's session_start() hangs.
am doing wrong here?
thanks
it's due locking; php locks session file while writing it. fix this, close session file when done modifying session variables using session_write_close()
.
i have had problem in past, , locking problem. sure explicitly tell php you're done modifying session using session_write_close()
, , should fine.
from documentation:
session data stored after script terminated without need call
session_write_close()
, session data locked prevent concurrent writes 1 script may operate on session @ time. when using framesets sessions experience frames loading 1 one due locking. can reduce time needed load frames ending session changes session variables done.
note: can set custom session handler , avoid file-locking problem entirely storing session information in database. @ kind of scale, pretty necessity.
Comments
Post a Comment