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.

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. kumargandhi says:

    yes i made a post on that too. here’s the link.

    Path of the SharedObject File at the client System.

    regards,
    kumar.

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

Leave a reply to やせ蛙 まけるな一茶 是にあり » Flex Cookie Cancel reply