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
Forgive the stylistic issue, but by using
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 :
No commit() call is necessary here.
This is more of a stylistic thing, but it also prevents programmer error