Closed Creastery closed 7 months ago
Hello Creastery,
I am still debating whether or not this is useful. On the bad side, it will always create a string such as _|<payload>
, which does not bring much. On the other side, your code is super clean and not everybody knows that sessions are encoded this way in PHP.
My logic is the following:
Therefore, I feel like this does not help any of the two groups.
I'd be interested in anybody's opinion as to whether or not we need to add this feature.
Having the --session-encode
option verbosely documented might help non-frequent users and provide a learning opportunity.
Hello Charles,
Thanks for your feedback. I do agree and understand with your reasoning, since the usage of session_encode()
payloads is rather niche.
For me though, I view this option as a small quality-of-life change, as this PR came about because of me repeatedly monkey-patching to switch between unserialize()
and session_encode()
more often than I would like to admit. :joy:
@jvoisin makes a good point, and @swapgs seems to agree. This PR gets merged.
Thanks to you all!
Hey Charles,
I'm suggesting a new option,
--session-encode
/-se
to allow generation of payloads usingsession_encode()
instead ofserialize()
.The rationale behind introducing this option is documented in the changes as well:
Since introducing the
--session-encode
option as an enhancement, wrapper or encoder would require deserialising the payload and re-serialising it withsession_encode()
, I opted to implement this inPHPGGC::serialize()
.