Use shared objects to synchronize users and store data. Shared objects can do anything from holding the position of pieces on a game board to broadcasting chat text messages. Shared objects let you keep track of what users are doing in real time.
Create and use remote shared objects, which share data between multiple client applications. When one user makes a change that updates the shared object on the server, the shared object sends the change to all other users. The remote shared object acts as a hub to synchronize many users. In the section SharedBall example, when any user moves the ball, all users see it move.
Adobe Media Server Standard does not support remote shared objects.
All editions of the server support local shared objects, which are similar to browser cookies. Local shared objects are stored on the client computer and don’t require a server.
Shared objects, whether local or remote, can also be temporary or persistent:
A temporary shared object is created by a server-side script or by a client connecting to the shared object. When the last client disconnects and the server-side script is no longer using the shared object, it is deleted.
Persistent shared objects retain data after all clients disconnect and even after the application instance stops running. Persistent shared objects are available on the server for the next time the application instance starts. They maintain state between application sessions. Persistent objects are stored in files on the server or client.
Persistent local shared objects
To create persistent local shared objects, call the client-side SharedObject.getLocal() method. Persistent local shared objects have the extension .sol. You can specify a storage directory for the object by passing a value for the localPath parameter of the SharedObject.getLocal() command. By specifying a partial path for the location of a locally persistent remote shared object, you can let several applications from the same domain access the same shared objects.
Remotely persistent shared objects
To create remote shared objects that are persistent on the server, pass a value of true for the persistence parameter in the client-side SharedObject.getRemote() method or in the server-side SharedObject.get() method. These shared objects are named with the extension .fso and are stored on the server in a subdirectory of the application that created the shared object. Adobe Media Server creates these directories automatically; you don’t have to create a directory for each instance name.
Remotely and locally persistent shared objects
You create remote shared objects that are persistent on the client and the server by passing a local path for the persistence parameter in your client-side SharedObject.getRemote() command. The locally persistent shared object is named with the extension .sor and is stored on the client in the specified path. The remotely persistent .fso file is stored on the server in a subdirectory of the application that created the shared object.