This will be posted to both the mod_perl and mason mailing lists.
I'm tearing my hair out here. I'm using Apache::Session with Mason (snippet
of calls to Apache::Session below). For some reason, when I hit certain
pages with java applets (opencube scroller), and then do a browser "refresh"
(IE5 and NS4.5) Apache::Session die()'s and posts:
[Mon Jan 10 12:27:43 2000] [error] Object does not exist in the data store
at /usr/local/lib/perl5/site_perl/5.005/Apache/Session/DBIStore.pm line 192.
Which typically happens when you request a session id that's not in the
store. A quick query reveals that the session is still there:
mysql> SELECT id, length FROM sessions WHERE id='48434f27feea873a';
+------------------+--------+
| id | length |
+------------------+--------+
| 48434f27feea873a | 41 |
+------------------+--------+
1 row in set (0.00 sec)
Jumping to a page that pulls the cookie from the browser and spits it out
shows that the cookie holds a new value (ie. bc7d790fa9f76185). Another
query shows that it exists as well:
mysql> SELECT id, length FROM sessions WHERE id='bc7d790fa9f76185';
+------------------+--------+
| id | length |
+------------------+--------+
| bc7d790fa9f76185 | 41 |
+------------------+--------+
1 row in set (0.00 sec)
>From what I've found so far, I can query $session for my _session_id.. then
if I request the cookie containing my session ID, I find that it is unset!
So naturally, another session ID is set and I loose all the old data.
So I have a couple questions here: How is my cookie getting "unset" /
mangled? How can I tell which "Object does not exist in the data store"
(ie. logging the session id in the error log)? What's the best way to debug
this?
### Setting up sessions for mason
my %session;
my $cookie = $r->header_in('Cookie');
$cookie =~ s/SESSION_ID=(\w*)/$1/;
tie %session, 'Apache::Session::DBI', $cookie, {
DataSource => 'dbi:mysql:mydb',
UserName => 'username',
Password => 'password'
};
$r->header_out("Set-Cookie" => "SESSION_ID=$session{_session_id};") if
!$cookie );
local *HTML::Mason::Commands::session = \%session;
$ah->handle_request($r);
untie %HTML::Mason::Commands::session;