Tryton - Issues

 

Issue7018

Title Preserve session on page reload
Priority feature Status resolved
Superseder Nosy List ced, fmorato, pokoli, reviewbot, roundup-bot
Type feature request Components sao
Assigned To pokoli Keywords review
Reviews 36911002
View: 36911002

Created on 2017-12-18.13:12:13 by pokoli, last changed by roundup-bot.

Messages
New changeset aa70a247758c by Sergi Almacellas Abellana in branch 'default':
Store session in browser storage
https://hg.tryton.org/sao/rev/aa70a247758c
review36911002 updated at https://codereview.tryton.org/36911002/#ps160001
review36911002 updated at https://codereview.tryton.org/36911002/#ps140001
review36911002 updated at https://codereview.tryton.org/36911002/#ps120001
review36911002 updated at https://codereview.tryton.org/36911002/#ps100001
review36911002 updated at https://codereview.tryton.org/36911002/#ps80001
review36911002 updated at https://codereview.tryton.org/36911002/#ps60001
review36911002 updated at https://codereview.tryton.org/36911002/#ps40001
msg38107 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-01-29.17:50:05
On 2018-01-29 17:34, Sergi Almacellas Abellana wrote:
> Ok, so I updated the review to store on localstorage, which allow to open multiple tabs on the same server (which is detected by the window.location) without repeating the credentials

window.location is not enough. It depends also on the database.
msg38106 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-01-29.17:34:54
Ok, so I updated the review to store on localstorage, which allow to open multiple tabs on the same server (which is detected by the window.location) without repeating the credentials
msg38101 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-01-29.16:45:05
On 2018-01-29 16:10, Sergi Almacellas Abellana wrote:
> I don't think we should auto-login for multiple tabs (as multiple tabs is the same as multiple instances of the tryton client). Otherwise is not possible to work on different companies with the same user and navigator, which is currently possible by using different tabs.

I do not see why it would not be possible. The context will not be
stored nor shared.
Also I do not think you should compare tabs of browser to instances of
desktop. They are different and we do not need to share a common
behaviour.
msg38099 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-01-29.16:10:42
I don't think we should auto-login for multiple tabs (as multiple tabs is the same as multiple instances of the tryton client). Otherwise is not possible to work on different companies with the same user and navigator, which is currently possible by using different tabs.
msg38098 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-01-29.15:50:39
Then will it not better to store for a longer time the session. This sessionStorage implementation will not allow to open multiple tabs nor support URL schema.
review36911002 updated at https://codereview.tryton.org/36911002/#ps20001
msg38096 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2018-01-29.14:14:12
> I'm concerned about multiple tabs opened with different connections. The sessionStorage is shared by all tabs connected to the same server. So for me, the session should be stored per user/database.

You don't have to worry. SessionStorage is not shared between tabs. See first paragraf of:

https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage
msg38080 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-01-27.14:46:07
I'm concerned about multiple tabs opened with different connections. The sessionStorage is shared by all tabs connected to the same server. So for me, the session should be stored per user/database.
msg38079 (view) Author: [hidden] (fmorato) Date: 2018-01-27.13:16:13
Working fine on my local install.

Nice feature, Thank you
review36911002 updated at https://codereview.tryton.org/36911002/#ps1
msg37336 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2017-12-18.13:12:12
From msg37332 it will be great to preserve the session when reloading the page.
History
Date User Action Args
2018-05-23 16:47:20roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg40967
2018-05-22 11:23:51reviewbotsetmessages: + msg40924
2018-05-21 13:26:38reviewbotsetmessages: + msg40801
2018-05-11 10:36:35reviewbotsetmessages: + msg40632
2018-05-10 18:07:35reviewbotsetmessages: + msg40618
2018-05-10 10:09:15reviewbotsetmessages: + msg40609
2018-04-27 11:00:52reviewbotsetmessages: + msg40428
2018-01-29 17:50:30reviewbotsetmessages: + msg38108
2018-01-29 17:50:06cedsetmessages: + msg38107
2018-01-29 17:34:54pokolisetmessages: + msg38106

Showing 10 items. Show all history (warning: this could be VERY long)