Skip to content

allow replace $_SESSION by ArrayAccess instance - #67

Open
esler wants to merge 3 commits into
dapphp:masterfrom
peoplepath:session_injection
Open

allow replace $_SESSION by ArrayAccess instance#67
esler wants to merge 3 commits into
dapphp:masterfrom
peoplepath:session_injection

Conversation

@esler

@esler esler commented Feb 7, 2017

Copy link
Copy Markdown

Sometimes you need to use custom session handler, this patch adds support for that.

@dapphp

dapphp commented Feb 15, 2017

Copy link
Copy Markdown
Owner

Hi,

Thanks for the suggestion and change. I am planning an upcoming release (branch nextgen) and have made some significant changes to the core code and changed things such that code storage is handled by something called a StorageAdapter.

The session support is replaced by the StorageAdapter\Session class, and we could do an ArrayAccess one that follows your method.

Also, at first glance at your code, it looks like when a code is stored, it would wipe out captcha data from other namespaces (for example, $_SESSION['securimage_code_value'] = array($this->namespace => $this->code);). It looks like if a previous code in another namespace was saved, this would destroy that and just save the new namespaced value.

Thoughts on the last comment and the upcoming changes?

@esler

esler commented Feb 16, 2017

Copy link
Copy Markdown
Author

Hi,
solution with adapter is definitely better but I needed quick and easy solution for current version. I'm using this pull request as a patch for my project's libs. It's not ideal solution but it's working and it's relatively clean.

Thanks for the notice about namespaces I missed that - it's fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants