Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DOCSP-45065: sessions documentation #3254

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
rustagir merged 4 commits into mongodb:5.x from rustagir:DOCSP-45065-http-sessions
Jan 29, 2025

Conversation

@rustagir
Copy link
Contributor

@rustagir rustagir commented Jan 27, 2025
edited
Loading

https://jira.mongodb.org/browse/DOCSP-45065

Adds documentation for HTTP Sessions

Staging

Checklist

  • Add tests and ensure they pass

Copy link
Contributor

@mongoKart mongoKart left a comment

Choose a reason for hiding this comment

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

straight 🔥

lgtm w/ a couple suggestions

Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

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

LGTM once the index creation snippet is more adapted to Laravel.

rustagir reacted with thumbs up emoji
Comment on lines 85 to 90
.. code-block:: sh

db.sessions.createIndex(
{ "expiry_field": 1 },
{ expireAfterSeconds: 0 }
)
Copy link
Member

Choose a reason for hiding this comment

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

The Laravel way to create this index is to use the Schema builder.

Schema::create('sessions', function (Blueprint $collection) {
 $collection->expire('expiry_field', 0);
});

rustagir reacted with thumbs up emoji
@rustagir rustagir merged commit 867731c into mongodb:5.x Jan 29, 2025
44 checks passed
.. code-block:: php

Schema::create('sessions', function (Blueprint $collection) {
$collection->expire('expiry_field', 0);
Copy link
Member

Choose a reason for hiding this comment

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

You should use the actual field name, not the name of the option that contains the field name.
Since people would not customize the field names, this will prevent them from creating a useless index without noticing.

 $collection->expire('expires_at', 0);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it! as i understand, this is the name of the field that is stored in the session documents?

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

Reviewers

@GromNaN GromNaN GromNaN left review comments

@norareidy norareidy norareidy approved these changes

@mongoKart mongoKart mongoKart approved these changes

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /