Skip to content

docs: improve session#6593

Merged
kenjis merged 11 commits intocodeigniter4:developfrom
kenjis:fix-docs-session
Sep 29, 2022
Merged

docs: improve session#6593
kenjis merged 11 commits intocodeigniter4:developfrom
kenjis:fix-docs-session

Conversation

@kenjis
Copy link
Copy Markdown
Member

@kenjis kenjis commented Sep 27, 2022

Description
Small improvements or fixes.

If we agree, I would like to remve all sample code that uses $_SESSION directly.

Checklist:

  • Securely signed commits
  • [] Component(s) with PHPDoc blocks, only if necessary or adds value
  • [] Unit testing, with >80% coverage
  • User guide updated
  • [] Conforms to style guide

@kenjis kenjis added the documentation Pull requests for documentation only label Sep 27, 2022
Copy link
Copy Markdown
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the UG used "userdata" throughout to indicate "non-flash data stored by the framework", because some actual $_SESSION items are not included:

$_exclude = array_merge(['__ci_vars'], $this->getFlashKeys(), $this->getTempKeys());

I'm fine with making this a little more opaque but we should note somewhere what is not included.

Otherwise: I am in favor of encouraging use of the Session handler over the global variable.

Comment thread user_guide_src/source/libraries/sessions.rst
@kenjis
Copy link
Copy Markdown
Member Author

kenjis commented Sep 29, 2022

There are some notes (important) to describe the items that the get() method returns
like the following:

The get() method WILL return flashdata or tempdata items when retrieving a single item by key. It will not return flashdata or tempdata when grabbing all data from the session, however.

And I added a note for the word "userdata".

@kenjis kenjis requested a review from MGatner September 29, 2022 02:18
Copy link
Copy Markdown
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I missed those other comments. Thank you for updating. LGTM!

@kenjis kenjis merged commit 09030e8 into codeigniter4:develop Sep 29, 2022
@kenjis kenjis deleted the fix-docs-session branch September 29, 2022 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Pull requests for documentation only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants