Project

General

Profile

Actions

Support #3909

closed

Best Way to Keep a Session Between Tabs

Added by Isaac Lascasas almost 10 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
03/20/2015
Due date:
% Done:

0%

Estimated time:

Description

Hello, I have been learning Wt for some months now. So far I'm very satisfied with the library, I appreciate a lot your efforts. Today I want to ask you about a simple way to deal with multitab/multiwindow browsking. My authentication method requires a custom but quite simple mechanism and I want to hear your opinions about my implementation and concerns.

My webapp requests a user name from a 3rd party system and sends a request code via PM to that user within that app (as in a typical phone/sms verification). Then the user will read the code in the 3rd party app and come back to the Wt website to write the request code. If the IP and code are ok, I log the user.

I have two questions here, first is if your authentication module will help in this situation given that right now I store everything within MongoDB. And second is if just manually storing a cookie to track the session between the tabs and windows sounds like a viable solution given that the rest of the code (ui, session in just one tab, login and 3rd party app pm sending) is already working.

Also I want to let you know that my biggest source of confussion is the fact that the session object is inside the Dbo namespace. As you can imagine I just want to let the user open tabs and don't force him to relog and I think my webapp doesn't require ::Wt::Dbo for anything more at all so I wonder if I really have a reason to store stuff inside a sqlite, etc.

Thanks a lot.

Isaac.

Actions #1

Updated by Koen Deforche almost 10 years ago

Hey,

To me it seems that your approach is fine. You could use Wt::Auth but not with it's default Wt::Dbo storage (you can reimplement Wt::Auth::AbstractUserDatabase to use a different storage option, which could be MongoDB.

But there is not necessarily a lot of value in Wt::Auth only to generate and store a random id for a cookie to track a user across sessions.

Regards,

koen

Actions #2

Updated by Koen Deforche almost 10 years ago

  • Status changed from New to Resolved
  • Assignee set to Koen Deforche
Actions #3

Updated by Isaac Lascasas almost 10 years ago

Thanks for the quick response. This helps me a lot.

Isaac.

Actions #4

Updated by Koen Deforche almost 10 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF