The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


AIS::client - get an authenticated e-mail address for users of your web service


  BEGIN{umask(0077 & umask())}; # if your web server gives you a 0177 umask
  use AIS::client;
  print "Content-type: text/plain\n\nWelcome $AIS_IDENTITY\n";
  print "this is page view number ", ++$AIS_STASH{accesses};


The goal of AIS::client is to provide a very easy way to require an authenticated identity for a perl web application. The user's e-mail address appears in a global variable $AIS_IDENTITY and a persistent session stash is available in %AIS_STASH.



By default, AIS::client will refer to the AIS service defined at but an alternate AIS service can be specified with the aissri parameter:

   use AIS::client aissri => '';

By default, AIS::client will give the URL of the webpage being requested as the agent string, but an alternate agent string can be specified with the agent parameter:

   use AIS::client aissri => "Bob's web services: account MZNXBCV";

It is expected that a subscription-based or otherwise access-controlled AIS service might issue expiring capability keys which would have to be listed as part of the agent string.


By default, AIS, which means that AIS::client will store session data (incliding identity, which is also available as $AIS_STASH{identity}) in subdirectories under a directory called AIS_sessions under the current directory your script runs in. This can be changed with the prefix parameter:

  use AIS::client prefix => '.AIS'; # hide session directory

The prefix is also used as the prefix for the session cookie name, which defaults to AIS_session.


By default, AIS::client will examine the session directory for stale sessions approximately once every 2000 invocations. Adjust this with the freq parameter. 0 will suppress housekeeping entirely.


Minimum time in seconds since $AIS_STASH{last_access} that will trigger session deletion at housekeeping time. Defaults to 72*60*60.


AIS::client recognizes a reserved QUERY_STRING of LOGOUT which will end a session, delete all session data, and offer the user a link to the logout function of the specified AIS server so they can log out of that too if they want.


        This is the first public AIS client module release with this
        interface, which is entirely different from the CGI::AIS::Session
        fixed the to call in DirDB
        installation problems due to permissions now go to the
        web browser instead of silently dying. 

        redirections now done with more portable REFRESH meta tags
        instead of (along with) less portable Location: headers


please use to report problems (and successes!) (And wishes!)


David Nicol <>


CGI::Session::Auth does something very similar.

CGI::AIS::Session is now deprecated and replaced.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 361:

'=item' outside of any '=over'

Around line 406:

You forgot a '=back' before '=head1'