Reputation: 1
Is it possible to share session objects like user object accross multiple browser? My requirement is if user tries to switch between different browsers(IE, Chrome or Fireforx), the application should allow the navigation along with sharing of user object.
Upvotes: 0
Views: 655
Reputation: 9166
It IS possible. But it would require you to write your own SessionIDManager
class:
http://msdn.microsoft.com/en-us/library/system.web.sessionstate.sessionidmanager.aspx
If you create your own SessionIDManager
YOU decide how you will determine if a request belongs to a specific session or not. The client IP should at least be one parameter, some application specific key could be another etc. The actual session key that is returned could be a suitable string representation of a hash of all the parameters (the generated session id MUST be unique for each session).
Once you have you SessionIdManager
done you can hook it up in web.config
:
<sessionState mode="[mode]" ...
sessionIDManagerType="[full type name of your class here]" ... />
So it can be done.
But I would personnally not make such a class unless there is some really compelling reason to do it:
And also, maybe most importantly:
Upvotes: 0
Reputation: 148110
Sharing session between browsers is not possible, Session cookie is used by browser to identify each client uniquely and it is stored in browser memory. So one browser is not allowed to access the memory of other browser and this makes it impossible to share session between different browsers. Reading more about session cookies could make it more clear.
Upvotes: 1