I am looking at the MasonX-Request-WithApacheSession module now, and will use it if I don't figure this out soon. I do like to understand things as best I can, though, which is worth some struggle. The items I add in that autohandler -- user permission level and group -- ARE saved, and the other info I want saved is visible at the end of that autohandler if I insert a print $session{SQLstatement} before the close of the autohandler. So that session value is not masked by the local *session; declaration in the init section, but they are also not saved as they are only around for that one request, while the above values persist. I do want to understand what is going on here with scoping, even if I use the module. thanks. | [reply] |
I don't really understand your description of what you're doing, but you should go and read the Apache::Session docs. They make it pretty clear that you have to make sure the object gets destroyed. Your "print $session{SQLstatement}" will not affect anything one way or the other.
| [reply] |
So, anyway, I got it to work by making the tied %session lexically scoped in the autohandler and then passing a reference down to all other components. But I'm still curious how they got it to work with the global -- teh book specifically discusses a global, localized in the autohandler but available elsewhere as a global. If nothing else, that section of the book may need a little flushing out in the next edition. Thanks for the offers of help.
| [reply] |