Skip to content

Allowing dot-notation arrays to be used in session data. #251

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

Merged
merged 2 commits into from
Feb 5, 2013

Conversation

bencorlett
Copy link
Contributor

Hi,

Let's say you have the following form:

<form>
    <input type="text" name="user[first_name]" value="{{ Input::old('user.first_name') }}">
</form>

This will not work under the current session implementation as the keys are limited to 1 deep, i.e. 'user' or 'user_first_name', but not 'user.first_name'. I have implemented array_set, array_get and array_forget (illuminate/support is already a dependency of illuminate/session so no issues there) to allow multi-dimensional arrays to be set.

There are several use-cases where you may wish to set / access multi-dimensional session data, HTML forms are but one of them.

  • Ben

…('foo.bar', 'baz');

Signed-off-by: Ben Corlett <bencorlett@me.com>
…also retrieved using array_get.

Signed-off-by: Ben Corlett <bencorlett@me.com>
taylorotwell added a commit that referenced this pull request Feb 5, 2013
Allowing dot-notation arrays to be used in session data.
@taylorotwell taylorotwell merged commit 206d8c1 into laravel:master Feb 5, 2013
@bencorlett bencorlett deleted the feature/deep-sessions branch February 27, 2013 22:31
joelharkes pushed a commit to joelharkes/framework_old that referenced this pull request Mar 7, 2019
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