On Thu, 23 May 2002, Cory Trese wrote:

> I know, I know.  I've been wondering how I missed this for so long ...
> it has made developing web applications fun again!

Yes, really!

> The 2.3 release does not provide this functionality, AFAIK.  However, that
> doesn't mean 'cgiapp_prerun( )' or 'cgiapp_init( )' can't be useful to you.

I've looked at the code and found that the run_mode is calculated before
calling the pre-run hook, and there is no way to tweak it there.

> What are you trying to achieve?

I need a way to handle sessions automagically. And I thought i can do
it this way:

- add two 'standard' run modes (new_session, check_session);
- use pre-run hook to check for the existence of a session;
  if there is no session, change run mode to new_session;
- inside new_session create a new session, save original request,
  and call (via redirect) run mode check_session;
- in check_session check if the cookie is there; if so redirect
  to the orginal run mode (restoring all saved parameters);
  else show some error.

I use cgiapp_init to pre-load the 'standard' run modes and avoid repeating
myself in every application. I don't know if there is a better way to
pre-load run modes, but it works.
All applications inherit these methods from Apps::Base, that is of course
a subclass of C::A.

I know that sessions can (and should) be handled by Apache, but
the current deploy environment does not permit any mod_perl.

All hints to do this in another way are welcome!

Thank you very much, Valerio


 Valerio Paolini, <http://130.136.3.200/~paolini>
--------------------------------------------------
 what is open-source about? Learn, and then give back


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/cgiapp@lists.vm.com/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to