Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,

i've been working and studying WCF for 2 weeks now, and i have a simple question.

Can multiple users connect to the same Session created by one user?

for example if a user Creates a game in the client, can multiple users connects to this session of the game? and this means that each game created is a session in the service.

Is this possible? An example from the internet would be appreciated :)

Am i asking the correct question?

Thanks,
Posted

About ASP.net Session

Sessions are identified by a unique identifier that can be read by using the SessionID property.

When session state is enabled for an ASP.NET application, each request for a page in the application is examined for a SessionID value sent from the browser.

If no SessionID value is supplied, ASP.NET starts a new session and the SessionID value for that session is sent to the browser with the response.

By default, SessionID values are stored in a cookie. However, you can also configure the application to store SessionID values in the URL for a "cookieless" session.

A session is considered active as long as requests continue to be made with the same SessionID value. If the time between requests for a particular session exceeds the specified time-out value in minutes, the session is considered expired.

Requests made with an expired SessionID value result in a new session.

For more info:ASP.NET Session State

Your Q : Can multiple users connect to the same Session created by one user?

Answer : Can't
 
Share this answer
 
v2
I would have a read of this article from here on code project:
WCF Sessions - Brief Introduction[^]
It's a pretty good description of how WCF sessions work.


The gist of it is that yes, if configured correctly every client that connects to your WCF service can share the same "Instance" of a WCF service by setting it up as a Singleton.
However the "Session" configuration would mean that Client A has a session, Client B has a different session. The final option is Per Call, where every single request call from any client, uses its own service instance.

That article explains it really well in my opinion, so have a read.
 
Share this answer
 
Comments
Sampath Lokuge 31-Oct-13 2:41am    
+5 Nice one.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900