coder
coder

Reputation: 2000

sharing session between different browsers

I am Working in asp.net and C# .

I have an application where user logs in to enter the application,if a user opens the application in a browser and logs in,and if user opens the application in some other browser in the same system they should be logged in as well.The same should happen within the same browser in different tabs and also in the different instance of same browser in which user was Previously logged in.please give me Your suggesions.....

Upvotes: 1

Views: 6161

Answers (3)

Midhun
Midhun

Reputation: 3988

You can share session between two browsers ,we have implemented such a project couple of years back .

The technique used was to write a custom browser which instead of storing cookies in local machine stored it in a in a public server so that when one guy logs in the cookie & other local data associated with the session is shared with the server and thus with all browser instances ,browsers instances cookie is modified to match with the server details ,So it behaves as if the session is shared . some websites have issue with using different ip that could be solved by using a common proxy server .

but if you can't use custom browsers then it will be difficult but could still try with plugins that follow the above mentioned method Hope this helps

Upvotes: 2

Icarus
Icarus

Reputation: 63956

The answer is, as stated above, that you can't share Sessions between 2 different browsers as each browser will necessarily start a new session.

If you want a way to allow the user to log in once and stay signed in even if he opens a different browser, then you would have to rely on his IP address since this is the ONLY indicator that the user that logged in Chrome 2 secs ago, may be the same user that's logging in from Firefox now. This is just to give you an example but this is obviously flawed because different users behind the same gateway will all have the same IP.

What you want to do would work only if the application you develop is inside an Intranet and you know for sure that every user will have a unique internal IP address but then the whole point of authenticating users may be achieved through more efficient ways, like Integrated Windows Auth, etc.

Upvotes: 4

Habib
Habib

Reputation: 223207

You can't share session between multiple browsers.

But session between multiple tabs of a same browser instance is already shared.

Upvotes: 5

Related Questions