Ticket #187 (closed task: fixed)

Opened 8 years ago

Last modified 4 years ago

Merge SetPersistentCookie and SetSessionCookie into SetCookie

Reported by: NilsLindenberg Owned by: JavaWoman
Priority: normal Milestone: 1.3.1
Component: core Version: 1.1.6.1
Severity: normal Keywords: cookie SetPersistentCookie SetSessionCookie
Cc:

Description

Since SetPersistentCookie is only used by SetUser and SetSessionCookie isn't used at all, and since both do the same job except for the time the cookie is valid, they can be merged into one function SetCookie with an optional time parameter (default would be "session").

The path of the cookie should be restricted to the actuall wiki-path (see #81).

Change History

Changed 8 years ago by NilsLindenberg

  • component changed from 3rdparty to core

Changed 8 years ago by NilsLindenberg

  • owner changed from unassigned to NilsLindenberg
  • status changed from new to assigned

Changed 8 years ago by NilsLindenberg

  • milestone changed from 1.1.7 to 1.1.7.1

Changed 7 years ago by JavaWoman

  • owner changed from NilsLindenberg to JavaWoman
  • status changed from assigned to new
  • milestone changed from 1.1.7.1 to 1.1.7

Milestone changed back to 1.1.7 (it's a no-brainer); and I'm taking this over as I'm already handling #81.

Changed 7 years ago by JavaWoman

  • status changed from new to assigned

Note: "SetCookie" is not a good name for the generic function: that's already the name of the PHP function itself. Using SetACookie() instead to avoid confusion.

Changed 7 years ago by JavaWoman

Since (currently) SetPersistentCookie() is used by Wikka (release) and SetSessionCookie() is not, it makes more sense to use the current persistence period (90 days) for a persistent cookie as the default, rather than making a session cookie the default. The default period can be defined as a constant.

Changed 7 years ago by JavaWoman

  • status changed from assigned to closed
  • resolution set to fixed

(In [668]) Better cookie handling

  • Ensures that the cookie path is always set to the path corresponding with Wikka's URL path - including session cookie (in wikka.php). Fixes #81
  • New method SetACookie() which supports setting both session cookies and (default) persistent cookies; old methods SetSessionCookie() and SetPersistentCookie are retained as wrapper functions for backwards compatibility (for now). Fixes #187
  • Enhanced DeleteCookie() to enable it to remove cookies with old (not suffixed) names and with a specific path
  • New method DeleteOldCookies() which removes old-name cookies as well as cookies with path set to root if the current path is not root; the Run() method now uses this method to clean up

Note that the code still contains some debug code; this will be cleaned up in a later phase.

refs #545

Changed 6 years ago by DarTar

  • milestone changed from 1.2 to 1.3

Retargeting to 1.3, this ticket has already been closed in trunk, from which 1.3 will be branched. Consider backporting urgent issues to 1.2.X

Changed 4 years ago by BrianKoontz

  • milestone changed from 1.3 to 1.3.1

Updated milestone to 1.3.1

Note: See TracTickets for help on using tickets.