lundi 7 septembre 2015

Remembering webpage location (url)

Working on an application, actually two applications, and have the same query about both, how to remember the url and what is the best or smoothest way to do so.

So use case 1 is, I have a webpage that uses three other webpages (and three internal ones, to display six different parts. So one is a wiki, one is a time reporting system, some news pages, and all is on six pages or tabs. In this case I want the webpage to "remember" where the user is on all six tabs. So if you go around looking at news, then flip to the time reporting, and then want to go back to news, it remembers what news page you where on rather than taking you to listing. (the different pages are all in iframes)

Second is when the user logs in, so I want to be able to send a link to a secure location, say invite them to a discussion, but they will be presented with a login prompt (using node passport). The problem is that express have a default location it will send you to once you have logged in, and if you use external authentication (say gmail or facebook) that will include a callback.

I could potentially store the information in a cookie, or I could maybe add something to the callback and make internal auth handle it by just remembering the url it was asked to supply in the first place, but can see some headaches with both solutions, so thought I would ask if there is a standard or ridiculously smart solution.

Aucun commentaire:

Enregistrer un commentaire