Howto have a logout emulation with Apache + mod_perl ?

This is difficult to have something working well because of
the caching done by the browsers. Here is how I proceed :

I have one logout script that user can call when they want to
logout from there current session.

	#!/usr/bin/perl
	#-----------------------------------------------------------------
	# File : logout.cgi
	# Description: Logout Script to use with Apache-AuthenCacheLDAP
	#	mod_perl module to allow SSO logout. It simply set a
	#	timer and redirect to an authenticated URL
	#-----------------------------------------------------------------
	use strict;

	use CGI;

	my $REDIRECT = 'http://srv.samse.fr/cgi-bin/myapp.pl';
	my $DELAY = 3;

	my $timestamp = time() + $DELAY;

	my $query = new CGI;
	print $query->redirect($REDIRECT . '?logout=' . $timestamp);

	exit 0;

I put this script in the same server as the redirection URL for time
synchronizing reason.

You need to copy this script on a place where no authentication is required
and replace the redirection URL to a location protected by Apache::AuthenCacheLDAP.

If you modify the name of the logout parameter, as for example:

	print $query->redirect($REDIRECT . '?logmeout_ofhere=' . $timestamp);

add the following mod_perl directive to the protected place:

	PerlSetVar LogoutPattern "logmeout_ofhere"

That's all :-)


