Are you using the same domain name throughout your site?
How is the path part of the cookie being set and what is it
being set to? (sorry i have never used mason).
The browser will not send the cookie
back if the domain does not match or the path that the
page is GETting or POSTing to is not an exact match
or a subdirectory of the path set in the cookie.
Here is the cookie set-up for my site:
Set-Cookie: GWCUID=6e4a4f798906217e; domain=.genwax.com; path=/; expires=Friday,
31-Dec-2010 14:00:00 GMT
this cookie will be returned to all pages at genwax.com since my path is set to
root.
hope this helps,
cliff rayman
genwax.com
Ian Mahuron wrote:
> 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;