[GH-ISSUE #122] [ENHANCEMENT] Rename cookies #8137

Closed
opened 2026-04-13 03:12:55 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @tklein1801 on GitHub (Oct 8, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/122

As a developer, I would like to be able to determine what certain cookies are called or define a certain prefix to create certain semantics. Therefore, it would be great if I could define this in my better-auth instance

Like

export const auth = betterAuth({
  database: pool,
  advanced: {
    cookie: {
      crossSubDomainCookies: {
        enabled: true,
        domain: 'better-auth.com',
        eligibleCookies: [] // what do I even put here?
      },
      prefix: "DEFINE_YOUR_PREFIX_RIGHT_HERE"
    }
  },
});
Originally created by @tklein1801 on GitHub (Oct 8, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/122 As a developer, I would like to be able to determine what certain cookies are called or define a certain prefix to create certain semantics. Therefore, it would be great if I could define this in my better-auth instance Like ```ts export const auth = betterAuth({ database: pool, advanced: { cookie: { crossSubDomainCookies: { enabled: true, domain: 'better-auth.com', eligibleCookies: [] // what do I even put here? }, prefix: "DEFINE_YOUR_PREFIX_RIGHT_HERE" } }, }); ```
GiteaMirror added the locked label 2026-04-13 03:12:55 -05:00
Author
Owner

@Bekacru commented on GitHub (Oct 8, 2024):

I'm not sure if we should allow changing the cookie prefix. It adds unnecessary complexity since cookie names are just identifiers, and having the ability to easily identify if a cookie is from "better-auth" by its name is valuable to keep.

However, for eligible cookies in cross-subdomain, we should have proper typed strings.

<!-- gh-comment-id:2400534384 --> @Bekacru commented on GitHub (Oct 8, 2024): I'm not sure if we should allow changing the cookie prefix. It adds unnecessary complexity since cookie names are just identifiers, and having the ability to easily identify if a cookie is from "better-auth" by its name is valuable to keep. However, for eligible cookies in cross-subdomain, we should have proper typed strings.
Author
Owner

@tklein1801 commented on GitHub (Oct 8, 2024):

Okay, but atleast we got one todo

  • Eligible cookies in cross-subdomain, should have proper typed strings.
<!-- gh-comment-id:2400659374 --> @tklein1801 commented on GitHub (Oct 8, 2024): Okay, but atleast we got one todo - [ ] Eligible cookies in cross-subdomain, should have proper typed strings.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8137