Search the web
Sign In
New User? Sign Up
apache-asp · Apache::ASP
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Apache::ASP and Apache::Session   Message List  
Reply | Forward Message #2100 of 2277 |
I know this has been mentioned before on the list, but I'm having a
heck of a time overriding $Session with Apache::Session. Josh advises:

"...I would use Apache::Session, which you can easily configure
to use by setting 'PerlSetVar AllowSessionState Off' and then setting
$Session to the Apache::Session object created in Script_OnStart."

http://groups.yahoo.com/group/apache-asp/message/1559

In Script_OnStart, I have:

use vars qw(%session);
my $id = $Request->Cookies('_session_id') || undef;
tie %session, 'Apache::Session::MySQL', $id, \%session_connect;
$Session = \%session;
$Server->RegisterCleanup(sub { untie(%session); });
$Response->Cookies('_session_id', $session{'_session_id'});

There's clearly a scoping issue there, though, because although both %
session and $Session are populated and read/writable within
Script_OnStart, they aren't from actual pages. I can fix that with
Script_OnParse:

my $code = $Server->{ScriptRef};
$$code = '<% $Session = \%session %>' . "\n$$code";

which seems /awfully/ clumsy. Is that really TRWTDI?

Secondly, I have an XMLSub that looks for certain information in
$Session. Previously, I could refer to $main::Session, but that
doesn't fly with the new overridden object. I don't know a way around
this one.

Any help would be appreciated. Thanks!




---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@...
For additional commands, e-mail: asp-help@...




Tue Jan 17, 2006 8:28 pm

eamon@...
Send Email Send Email

Forward
Message #2100 of 2277 |
Expand Messages Author Sort by Date

I know this has been mentioned before on the list, but I'm having a heck of a time overriding $Session with Apache::Session. Josh advises: "...I would use...
Eamon Daly
eamon@...
Send Email
Jan 18, 2006
6:23 am

Well, I still can't muster the magic to get $Session properly[1] viewable from ASP::XMLSubs or any other module, but here's how to get ... PerlSetVar NoState 1...
Eamon Daly
eamon@...
Send Email
Jan 21, 2006
7:33 pm

I could have /sworn/ I'd tried that! In any case, that works great. Thanks! ____________________________________________________________ Eamon Daly ... From:...
Eamon Daly
eamon@...
Send Email
Jan 21, 2006
11:13 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help