Commit info for scoop/lib/Scoop:

Modified Files:
	ApacheHandler.pm Cookies.pm Cron.pm 
Added Files:
	Session.pm 
Log Message:
Adding a Scoop::Session module, which removes the dependency on
Apache::Session. This one doesn't use deadlock-prone locking as the previous
one did, and seems to perform better (in a simple benchmark). It should also be
compatible with most databases without any changes, as it uses simple queries.
Also updated sessionreap cron to work with the new session table.

There's no migration script; it's not worth the effort. Users will just have to
log back in.




Index: ApacheHandler.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/ApacheHandler.pm,v
retrieving revision 1.75
retrieving revision 1.76
diff -r1.75 -r1.76
206,210c206,208
< 	# Do cookie-related things...
< 	# Moved to last so that everything else has a chance to decide 
< 	# if we need a session cookie or not
< 	$S->_handle_cookies();
< 
---
> 	# note: the call to _handle_cookies has moved to page_out so that boxes can
> 	# be taken into account when deciding whether to send a session cookie
> 	
219c217
< 		tied(%{$S->{SESSION}})->delete();
---
> 		$S->session->flush;
221c219
< 	
---
> 

Index: Cookies.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Cookies.pm,v
retrieving revision 1.10
retrieving revision 1.11
diff -r1.10 -r1.11
5a6,19
> sub _get_cookies {
> 	my $S = shift;
> 	my $cookie = shift;
> 	my @cookies = split /;\s*/, $cookie;
> 	my $cookie_jar = {};
> 	foreach my $cookie_crumb (@cookies) {
> 		my ($name, $val) = split /=/, $cookie_crumb;
> 		$cookie_jar->{$name} = $val;
> 	}
> 
> 	return $cookie_jar;
> }
> 
> 
72,76d85
< # Note that sometimes we set another cookie. This is to phase out the old style
< # cookie name (plain session) in favor of a session cookie that includes the
< # site id.
< #
< # XXX - remove the second one after awhile (once it's all phased out).
85,88d93
< 
< 	if ($S->{COOKIES}->{session} && !$cookie->{value}) {
< 		$S->apache->headers_out->{'Set-Cookie'} = "session=$end";
< 	}

Index: Cron.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Cron.pm,v
retrieving revision 1.25
retrieving revision 1.26
diff -r1.25 -r1.26
645c645
< 		WHERE => "last_accessed < DATE_SUB(NOW(), Interval $length $unit)"
---
> 		WHERE => "last_update < DATE_SUB(NOW(), Interval $length $unit)"