Using SharedObjects for Cookies in Flex.

I can say that SharedObjects are the Full extension for normal Browser cookies, because it has features that are not in normal browser cookies.
The Basic meaning is same “They are used for storing client data on the client Harddisk”.And access them through out the site when live or access them on next visit.

As the Syntax differs:

public var mySO:SharedObject;
mySO = SharedObject.getLocal(“mydata”);

here mydata is the file used to store the user data on the client machine and they reside at
a particular path that is hidden.[ see Flex help file for Path]

The SharedObject class has some methods in it for storing user data.

getLocal() -> creates the file or copies the reference of the file if created.

and to store data.
mySO.data.visitDate=”TodayDate”;

As i said its “Full extension for normal Browser cookies”,its meaning is it can store data
of Three DataTypes– Date,String,Array.

mySO.flush();

flush() —> its used for writing the values in to the file.And the SharedObject files are
Stored in the .sol format.

mySO.clear();

clear() –> delete the file.[.sol]

Explore the Class.

Advertisements

5 Responses to Using SharedObjects for Cookies in Flex.

  1. Sajain says:

    Can you give an example in which a cookie is send with a POST?

  2. kumargandhi says:

    Here the concept is not using the POST or GET methods, the concept is to store the user data on to the client system and for this SharedObject Creates a file and writes the data in to it as the above post describes. And it’s more or like writing in to a file than sending in to a file.For writing we just need some permissions and for sending we need some services.
    Here the latter one. Comment me for further queries.

    regards,
    Kumar.

  3. Deb says:

    Thanks for the tip. It was very useful.

    Do you know where the .sol file is stored in the client hard disk?

  4. […] SharedObjects for Cookies in Flex. https://flexonblog.wordpress.com/2008/03/17/using-sharedobjects-for-cookies-in-flex/ カテゴリー: Cookie タグ: コメント (0) トラックバック (0) […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: