Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow replace $_SESSION by ArrayAccess instance #67

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

esler
Copy link

@esler esler commented Feb 7, 2017

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

@dapphp
Copy link
Owner

dapphp commented Feb 15, 2017

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
Copy link
Author

esler commented Feb 16, 2017

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