Stateful server and Unity?

Hi,

Is there any reason that in any of Unity builds (Windows, OS X, iPhone, iPod…) I should not rely on server-side sessions, meaning that session cannot be established like in browser applications (cookie stuff etc…)?

(btw I’ve tested the web version and server-side sessions work perfectly in all browsers and systems)

To explain it further: my client demands that all the state should be mainteined by Unity app (for instance Username, Password, UserId) and all of this authentication data should be sent to server with each request (like the authentication in SOAP headers, but the reason here isn’t a security but he should have a stateless server, cause “you can’t rely on session state”).

I can’t see why not to login and authenticate (via HTTPS) on app start (by sending auth data to server) and from there to keep everything in server session and communicate via HTTP (when sending non-sensitive data) by passing a session ID around.

Thanks!

Danko

sessions only work in the browser builds. reason is that the browser build uses the browsers HTTP channel for WWW (for session and caching reasons)

all others use tcp connections (iphone uses NSURLConnection since 1.6) where you would have to pass stuff forward and backward to get the automatism.

Thanks, this was very helpful!

I tested Unity Windows build with ASP.NET back-end. And really, a new session is started on each single request (HttpContext.Current.Session).

However, you can completely rely on the application state (HttpContext.Current.Application). It works as expected (started once and is shared between users).

D.

I’m wondering if stateful server could be done using cookieless sessions, i.e. by posting the session ID back and forth as part of the URL?

Don’t see why not.
We’ve been using such a similar attempt for our server backend that needs to retrieve / update player data from a restful webservice.