User permission check and session improvements

This PR fix a problem with the `module_configure.html` view, for which permission was `resource="admin.module"`. This is wrong, as the permission to check here is `module=the_module_code`.

The permission checking process is slightly improved, to redirect the user who do not have the require permissions to the "Sorry, you're not allowed to perform this action " error page instead of always redirecting to the login page.

The session lifetime can now be configured with the `session_config.lifetime` configuration variable, with a default of 0.

There's also a kind of fix for #909, to hide the useless `session_config.handlers` variable, while keeping it for a possible (?) future use.