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

Using Sentinel statelessly without starting session #548

Open
MirazMac opened this issue Jan 19, 2021 · 3 comments
Open

Using Sentinel statelessly without starting session #548

MirazMac opened this issue Jan 19, 2021 · 3 comments

Comments

@MirazMac
Copy link

Your Environment

  • OS and Version: Windows 10
  • PHP Version: 7.4.2
  • Sentinel Version: ^4.0

Expected behaviour

I'm using sentinel via the Native Facade. My app is an API thus it doesn't start a session. And sentinel shouldn't start one as well for stateless authentications.

Actual behaviour

Whenever I call any method via the Native Facade, it automatically starts a PHP session. Since my app is stateless, I don't want to start a session. Even calling Sentinel::stateless(); starts a session.

Is there any way I can use Sentinel statelessly without PHP session?

@brunogaspar
Copy link
Member

Hey

It's creating a session because the native implementation do so require it.

I understand it might be undesirable that calling the stateless() method to create a session, but at the moment, with this code, that's not possible to do.

Unsure if there's a way, without many changes to the current native implementation, to achieve this, otherwise, you can just create your StatelessSession class and instruct Sentinel to use it perhaps. Just an idea.

@suwardany Any other ideas?

@MirazMac
Copy link
Author

Hey

It's creating a session because the native implementation do so require it.

I understand it might be undesirable that calling the stateless() method to create a session, but at the moment, with this code, that's not possible to do.

Unsure if there's a way, without many changes to the current native implementation, to achieve this, otherwise, you can just create your StatelessSession class and instruct Sentinel to use it perhaps. Just an idea.

@suwardany Any other ideas?

Thanks for the response. Any idea how can I set my own Session handler to Sentinel? I don't see it in the docs. Thanks!

@sawirricardo
Copy link

Hi, any updates on this? I also am inteerested with this.

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

No branches or pull requests

3 participants