Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Add setting for cookie name prefix to plugin settings

未关闭
#892 5 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
php, wordpress

调研方向

Start with the functions.php workaround and the plugins_loaded entry point, then trace wpAuth0()->getSdk() through its configuration and the existing plugin settings. Add an optional admin setting for the cookie-name prefix, and confirm that it updates the session and transient storage IDs for the Pantheon use case.

由索引模型根据 Issue 内容生成。

描述

Good First Issue Scope: Improvement
Checklist
  • I have looked into the Readme and the documentation, and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.
Describe the problem you'd like to have solved

v5 appears to have removed the hooks mentioned in this issue. I am using pantheon, and need to prefix the cookie names with STYXKEY_ to avoid cookies being lost due to the CDN.

Describe the ideal solution

The ideal solution would be to add an optional field to the plugin's settings in the WordPress admin dashboard to set the SDK configuration object's storage IDs with the prefix. This would save custom work needing to be done to achieve this with the plugin.

Alternatives and current workarounds

I achieved a workaround by adding a plugins_loaded action in functions.php of my site as follows:

// change the auth0 cookie name to be prefixed with STYXKEY_ for Pantheon
function update_auth0_cookie_storage_id()
{
  $auth0SDK = wpAuth0()->getSdk();
  $auth0Config = $auth0SDK->configuration();
  $storageId = 'STYXKEY_' . $auth0Config->getSessionStorageId();
  $transientId = 'STYXKEY_' . $auth0Config->getTransientStorageId();
  $auth0Config->setSessionStorageId($storageId);
  $auth0Config->setTransientStorageId($transientId);
  $auth0Config->setSessionStorage(new CookieStore($auth0Config, $auth0Config->getSessionStorageId()));
  $auth0Config->setTransientStorage(new CookieStore($auth0Config, $auth0Config->getTransientStorageId()));
  $auth0SDK->setConfiguration($auth0Config);
}
add_action('plugins_loaded', update_auth0_cookie_storage_id());

I was able to update the configuration of the SDK by using this method. However, it took me a while of reading the source code of the plugin and SDK to find this solution, so I am proposing adding a setting in the Plugin settings on the WordPress admin dashboard.

Additional context

Pantheon Cache Docs for reference here.

主要语言
PHP
星标
184
派生
105
平均合并
1 天 5 小时
30 天内合并 PR
6

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

auth0/wordpress 的其他 Issue

查看 auth0/wordpress 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。