[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: newbie question mod_perl2 ajax
From:       Collin Monahan <cmonahan () yahoo ! com>
Date:       2008-08-16 11:27:48
Message-ID: 580596.45395.qm () web32007 ! mail ! mud ! yahoo ! com
[Download RAW message or body]

> Under mod_perl, packages/scripts remain in memory across requests, for the 
> duration of the Apache child.
> The second issue is that, due to the stateless nature of HTTP, requests are 
> dispatched to Apache/mod_perl children at random. You can't store 
> information about a particular user or user's session in a perl variable and 
> expect that user's next request to be sent to the same Apache/mod_perl 
> process. This is why there are so many modules and techniques for storing 
> user session/state information using various files and databases.

Indeed, thanks. I let a javascript function receive the result from the Ajax perl \
function, rather than the <div> element directly. Then also in a <script> block I put \
the declarations of those few state variables I wanted. I guess that way they will be \
in the memory on the client browser side, which is what I intended. Then the \
javascript can do what needs to be done to incorporate the server response into the \
local page state and update the div(s) accordingly. This leaves me with only two \
problems, a lack of javascript knowledge and the cumbersome way to put javascript \
into strings in the handler module, for example I ended up escaping some quotes as \
\\\", others as \", and then the perl quotes as ".



      


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic