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

Implement DeleteSession method in LocalSessionModule #50

Closed
bufferUnderrun opened this issue Nov 7, 2016 · 5 comments
Closed

Implement DeleteSession method in LocalSessionModule #50

bufferUnderrun opened this issue Nov 7, 2016 · 5 comments
Assignees

Comments

@bufferUnderrun
Copy link
Contributor

Hi,

I am facing an issue (not really a bug) with the LocalSessionModule and i will trying to explain clearly, not easy.

  1. When a user connects to my app (ie: index.html), Embedio always starts a session (in memory) and so a cookie "__session" is created in his browser. No problem.
  2. Then, the user login and i add some extras infos to check security (roles based) to the embedio session (session.Data.TryAdd("user-roles", new List<String>() { "admin", "debug" })). No problem.
  3. At the end, the user logout and because there is no "DeleteSesssion()" method, i simply delete all extras infos i've added with session.Data.Clear(). The session in Embedio is always enabled but do no rely on extras infos i used to check securty (this user is not admin anymore). A new session is started for the user, new session in Embedio and the browser get a new "__session" AND the old one. No problem.
  4. BUT, when the user refresh his browser, the 2 "__session" cookies are send (";" separed) and Embedio take the first valid, the old one because always in memory and not the new...

Could you add a new method DeleteSession(SessionInfo session) in the LocalSessionModule to properly delete a session in embedio ?

Thanks.

@mariodivece
Copy link
Member

Do you mind creating a pull request or proposing the code right here in the issue?

@bufferUnderrun bufferUnderrun changed the title How to properly Delete a Session (cookie session __session) in Embebio Implement DeleteSession method in LocalSessionModule Nov 7, 2016
@bufferUnderrun
Copy link
Contributor Author

@mariodivece You're right, it's more a pull request (enhancement) than issue. See my proposal. It should work but as usual, i've not installed vs2015 yet, so i can't test...

PS : arghhh github don't support file with "patch" extension, it's a shame...

@mariodivece
Copy link
Member

Thanks @bufferUnderrun I have committed the changes.
@geoperez could you please update the NuGet package?

@bufferUnderrun
Copy link
Contributor Author

thanks

@geoperez
Copy link
Member

geoperez commented Nov 7, 2016

The new Nuget was published.

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

No branches or pull requests

3 participants