The hook_init has a couple of path that are excluded.

Right now this breaks services functionality. It would also be great if the list was configurable.

Here's my change

    // Exclude from the redirect.
    if ((arg(0) == 'session' && arg(1) == 'limit') || arg(0) == 'logout' || arg(0) == 'services') {
    // Added 'services' path.

Comments

johnennew’s picture

Version: 6.x-2.1 » 7.x-2.x-dev

Moving to head.

What is the problem with services? Why would services need different session limitation behaviour?

I do like the idea of this being configurable, potentially via a hook:

/**
 * Implements hook_session_limit_bypass().
 *
 * @return bool
 *   TRUE if the page request should bypass session limitation restrictions.
 */
function hook_session_limit_bypass() {
  if ((arg(0) == 'session' && arg(1) == 'limit') || arg(0) == 'logout') {
    return TRUE;
  }
}

/**
 * Implements hook_session_limit_bypass().
 */
function services_session_limit_bypass() {
  if (arg(0) == 'services') {
    return TRUE;
  }
}
johnennew’s picture

Title: Issues when using Services » Hook session limit bypass
Category: bug » feature
Status: Active » Needs review
StatusFileSize
new3.42 KB

I am changing this issue to feature request to add a hook called hook_session_limit_bypass. If someone thinks this module should provide the bypass on behalf of services please say so - I do not understand why services would need it.

Mechanism for doing this implemented in attached patch for review. Includes an api file.

johnennew’s picture

Version: 7.x-2.x-dev » 6.x-2.x-dev
Status: Needs review » Active

Tests pass - committing to 7.x-2.x setting to 6.x-2.x for back port

johnennew’s picture

Status: Active » Needs review
StatusFileSize
new2.91 KB

Patch for 6.x-2.x ready for review.

johnennew’s picture

Status: Needs review » Fixed

Tests pass! committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.