[MP2][QUESTION]Session and inactivity
------=_Part_10290_1235706.1202296497285
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hello mod_perl users,
I am developing a mod_perl module (MyModule) to manage
sessions/authentication.
This module:
- uses Apache::Session to store session-related information
- is cookie-based
- manages session inactivity
This module could be used in the following example.
<Location /protected_url>
PerlAuthenHandler MyModule
AuthType Basic
AuthBasicProvider ...
require valid-user
PerlFixupHandler MyModule->cookie_create_refresh
</Location>
If request has no cookie, then basic authentication is required.
If basic authent is correct, then a cookie is created in the fixup
handler.
If request has a cookie, then the cookie is refreshed in the fixup handler.
A basic description of the module in pseudo-perl:
package MyModule;
use Apache::Session::xxx;
use Apache::Cookie;
sub handler{
my $r = shift;
if (cookie_not_present_in_request()){
return DECLINED;
}
return cookie_verify(); #use of Apache::Session as a DB storage
}
sub cookie_create_refresh{
my $class = shift;
if (cookie_not_present_in_request()){
create_cookie_with_Apache::Session::xxx_module();
create_cookie_with_Apache::Cookie_module();
}
else {
refresh_cookie_with_Apache::Session::xxx_module();
refresh_cookie_with_Apache::Cookie_module();
}
return OK;
}
The module I am developing has to delete the cookie if it is not refreshed
regularly.
The question: how can I manage this timeout inactivity ?
The best solution would be to use a mechanism where callbacks (deleting the
cookie rfom the database) would be called automatically on inactivity.
Does such an API is proposed by :
. the APR API
. mod_perl API
. an Apache2::xxx perl module
. a CPAN module
If not, how can I solve my problem ? (I could verify regularly in the DB
storage, but this is a last resort solution. Even in this case, how could I
implement it ?)
Thanks
Gaetan
------=_Part_10290_1235706.1202296497285
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hello mod_perl users,<br><br>I am developing a mod_perl module (MyModule) to manage sessions/authentication.<br>This module:<br> - uses Apache::Session to store session-related information<br> - is cookie-based<br>
- manages session inactivity<br><br>
This module could be used in the following example.<br>
<br><Location /protected_url><br>PerlAuthenHandler MyModule<br> AuthType Basic<br>AuthBasicProvider ...<br>require valid-user<br>PerlFixupHandler MyModule->cookie_create_refresh<br></Location><br><br>If request has no cookie, then basic authentication is required.<br>
If basic authent is correct, then a cookie is created in the fixup handler.<br> If request has a cookie, then the cookie is refreshed in the fixup handler.<br><br><br>A basic description of the module in pseudo-perl:<br>
<br>package MyModule;<br>use Apache::Session::xxx;<br>use Apache::Cookie;<br><br>sub handler{<br> my $r = shift;<br><br> if (cookie_not_present_in_request()){<br> return DECLINED;<br> }<br> return cookie_verify(); #use of Apache::Session as a DB storage<br>
}<br><br>sub cookie_create_refresh{<br> my $class = shift;<br> if (cookie_not_present_in_request()){<br> create_cookie_with_Apache::Session::xxx_module();<br>
create_cookie_with_Apache::Cookie_module();<br>
}<br> else {<br> refresh_cookie_with_Apache::Session::xxx_module();<br>
refresh_cookie_with_Apache::Cookie_module();<br> }<br> return OK;<br>}<br><br>The module I am developing has to delete the cookie if it is not refreshed regularly.<br>The question: how can I manage this timeout inactivity ?<br>
The best solution would be to use a mechanism where callbacks (deleting the cookie rfom the database) would be called automatically on inactivity.<br>Does such an API is proposed by :<br> . the APR API<br> . mod_perl API<br>
. an Apache2::xxx perl module<br> . a CPAN module<br><br>If not, how can I solve my problem ? (I could verify regularly in the DB storage, but this is a last resort solution. Even in this case, how could I implement it ?)<br>
<br>Thanks<br><br>Gaetan<br><br>
------=_Part_10290_1235706.1202296497285--