On Tue, 2003-10-21 at 03:46, [EMAIL PROTECTED] wrote: > I made two calls to ties for a test and the server comsume alot of CPU and > never return. So I don't know what is going on. > > ... > print "Content-type: text/html\n\n"; > tie %session, 'Apache::Session::File', undef; > $sessId = $session{_session_id}; > print "id: " . $sessId . "\n"; > > #the prog get hung when I added this line > tie %session, 'Apache::Session::File', $sessId; > $sessId = $session{_session_id}; > print "id: " . $sessId . "\n"; > ...
What's going on is that Apache::Session uses locking to prevent more than one access to a single session at a time. This is a bad idea for most applications, and can be turned off if you use Apache::Session::Flex with the NullLocker as your locking module. > In any case, are you saying that I have to pass the sessionId to the > client as a cookie as in the doc? If so, isn;t there a package that > already wraps this up for me? Yes and yes. Take a look at Apache::SessionManager. If that doesn't do it for you, look at CGI::Session. It is much more actively maintained than Apache::Session, and has better documentation and better support for new users. - Perrin