Problem/Motivation

To consolidate the module structure, would it be possible to remove the JS Cookie dependency?

First proposed by @herved in #3449275: JS Cookie needs to be enabled automatically when updating.

Steps to reproduce

See that JS Cookie is required, and wonder if it's possible to phase it out, and reduce the module dependencies.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#6 3557620-6.patch6.99 KBtimohuisman

Issue fork autologout-3557620

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ressa created an issue. See original summary.

herved made their first commit to this issue’s fork.

herved’s picture

Status: Active » Needs review

MR created
This probably deserves a mention in the release note that the dependency on js_cookie module was removed and sites can uninstall it themselves if unused.

the_g_bomb’s picture

Added a query

timohuisman’s picture

StatusFileSize
new6.99 KB

I’ve tested MR!83 with version 2.0.1 on drupal/core 11.2.x and can confirm that it works as expected. After disabling and removing the js_cookie dependency from my project, the logout functionality continues to work correctly.

One remaining concern is the sameSite attribute. In the js-cookie library, the default value for sameSite is not set, so explicitly setting it to lax would change the current behavior. See: https://github.com/js-cookie/js-cookie?tab=readme-ov-file#samesite

Because of this potential behavior change, I’m leaving my review status at Needs review for now. Without the sameSite consideration, this would be RTBC from my side.

The patch includes a snapshot of the current state of the MR and can be safely applied using composer-patches.

the_g_bomb’s picture

Status: Needs review » Reviewed & tested by the community

Happy not to bikeshed this over the sameSite value. Lax is the default for most browsers in any case.

anybody’s picture

Any plans to merge this? Looking at the MANY maintainers, it might be a good time to clean up inactive ones, also for security reasons?

the_g_bomb’s picture

I have outlined the path to a new version in #3390554: [META] Roadmap to new release before releasing a new version.

While I could just start merging, I would prefer #3339695: Use Drupal.dialog call instead of jQuery dialog to go in first and clear the way for all the other tickets outlined in the ticket above.

the_g_bomb’s picture

Status: Reviewed & tested by the community » Fixed

Merged

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

mikemccaffrey’s picture

For the love of god do not remove module dependencies in minor versions. We have deployed the security update to our test environment and now Drupal is going on and on about the missing the js_cookie module that is still enabled, and now we need to add it as a composer dependency just so we can cleanly disable the module in live on deploy.

ericgsmith’s picture

At the very least mention the removal in the release notes https://www.drupal.org/project/autologout/releases/2.0.2

handkerchief’s picture

Same here, the workaround:

drush state:set system.maintenance_mode 1
drush cr
composer update drupal/autologout --with-all-dependencies
composer require 'drupal/js_cookie:^1.0'
drush cr
drush updb
drush pmu js_cookie
composer remove drupal/js_cookie
drush state:set system.maintenance_mode 0
drush cr
the_g_bomb’s picture

Apologies, in hindsight, this should have been a major verison release.

joaopauloscho’s picture

I’m wondering why the hook update to install js_cookie is still present. I’m updating the module from 1.4.0 to 1.7.0 and encountered an error when running database updates.

the_g_bomb’s picture

Status: Fixed » Closed (fixed)

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