# \[as3\] Share Objects only working locally

**URL:** <https://forum.kirupa.com/t/as3-share-objects-only-working-locally/314267>\
**Category:** flash\
**Created:** [September 23, 2010, 9:15am UTC](https://forum.kirupa.com/t/as3-share-objects-only-working-locally/314267 "2010-09-23T09:15:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![amietbeach](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@amietbeach](https://forum.kirupa.com/u/amietbeach)\
**Post date:** [September 23, 2010, 9:15am UTC](https://forum.kirupa.com/t/as3-share-objects-only-working-locally/314267/1 "2010-09-23T09:15:31Z")

</div>

Howdy!

I’m having problems with Shared Objects. They seem to work on my machine but when I put them on a server they’re not working anymore.

Basically I have a page with a video player and I only want the video to play when the user visits the page for the first time.

This is the code:

```php

var beenVisited:Boolean=false;
var shared:SharedObject= SharedObject.getLocal("visited");
if (shared.data.visits==undefined) {
    shared.data.visits = 1;
    beenVisited=false;
    player1.play();
}
else {
    shared.data.visits ++;
    beenVisited=true;
    player1.stop();
}
shared.close();

```

I have tried deleting the .sol file and it didn’t change anything.

Any encounter this problem before?

I’ve tested with Firefox and Chrome. My version of Flash Player is 10.
