Skip to content

Remove commit() concept in favor of array set? #4

Description

@jleaders

Forgive the stylistic issue, but by using

change
change
change
commit

pattern as you set the values, someone may forget to commit() -- especially since the default PHP $_SESSION handler has no "commit" concept. (I'm aware many ORM's do, however)

Obviously it exists for performance/locking reasons, but a simple way around this is to require the set to be done via an array, for example in another library :

$session->set([
    "customer-name" =>  "Volition",
    "last-accessed" =>  time(),
    "location"      =>  "Skies",
]);

No commit() call is necessary here.

This is more of a stylistic thing, but it also prevents programmer error

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions