-1

I need to implement multi-use of the site in different browser tabs. After login, the browser writes the data in the cookies and if I open a new tab - I use the same profile, if I open a new tab and will be logged as user 2, I'm out of the user 1.

I know I can use chrome.webRequest to change the Headers, and the data about the current user stored in LocalStorage. But if I put it in LocalStorage user: user1 and the second tab will overwrite for user: user2, I will have the same result.

What are the options for solving my problem? I need to use this code to change the cookies? Someone did a similar task? There are examples?

Cœur
  • 37,241
  • 25
  • 195
  • 267
VINET
  • 641
  • 1
  • 7
  • 28

2 Answers2

0

Can you use an incognito window for user2? Thats what we ussually do, if we want to have multiple users on at the same time...

Or not quite what your asking?

0

I don't know why you need to have 2 or more profile active in the same time on the same browser.

My idea for your problem is to use an array to stock the account, but then you need to ask at user what is the account his/her want to use.

I hope I have helped you, but i don't know what is your goal.

L. Ros.
  • 114
  • 1
  • 2
  • 9
  • This is a test task for the device to work. I can't figure out how to implement the task described. – VINET Dec 13 '17 at 20:48
  • @VINET My idea is to create an array to store the name of account, like this [linl](https://stackoverflow.com/questions/3357553/how-do-i-store-an-array-in-localstorag), but when the user go open the new tab, you need to ask he/his what account want – L. Ros. Dec 13 '17 at 20:59
  • So too it is impossible by the order. I think I found the solution, I can get idifikator tabs and store it accordingly user. How to properly modify the header and in which file? – VINET Dec 13 '17 at 21:29
  • I know only how to storage data with JavaScript, using cookies, but i think that ia not your idea. I hope that you find the solution. – L. Ros. Dec 13 '17 at 22:48