Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

HTML extension panel: save the settings in a 'cookies'

Engaged ,
Jun 26, 2015 Jun 26, 2015

HTML/CSS/JS extension panel:

Is it possible to save the panel settings in a 'cookies', as in a standard web browser?

If this is possible, how?

Thanks!

Сообщение отредактировано: m s

TOPICS
SDK
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Aug 18, 2016 Aug 18, 2016

Instead of "cookies" is better to use Storage object.

It is much more convenient and works in any version of CC-Illustrator.

Maybe this topic is in the wrong section.

Translate
Adobe
Engaged ,
Jun 27, 2015 Jun 27, 2015

The version of the OS and Illustrator: Illustrator CС/2015x64, OS Win8.1x64

The guide "USING THE ADOBE EXTENSION SDK" says that "cookies" are stored here:

"CEP 4.2 supports persistent cookies stored in the user's file system:

In Windows: C: \ Users \ <user> \ AppData \ Local \ Temp \ cep_cookies "

Is this true for CEP5 / 6?

How to write and how to read out the information?

Method document.cookies = 'VasyaPupkin' does not work. Why is that?

Maybe I'm in the wrong section posted topic.

Request to moderators: transfer, please subject to the correct partition (say, Illustrator Scripting).

Thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 27, 2015 Jun 27, 2015

The CC2014 can't neither record nor considered a "cookie".

But this function is works fine in CC 2015 Illustrator:

    function setCookie ( name, value, options /*expires,path,domain,secure*/ ) {

      options = options || {};

      var expires = options.expires;

      if ( typeof expires == "number" && expires ) {

        var d = new Date ();

        d.setTime ( d.getTime () + expires * 1000 );

        expires = options.expires = d;

      }

      if ( expires && expires.toUTCString ) {

        options.expires = expires.toUTCString ();

      }

      value = encodeURIComponent ( value );

      var updatedCookie = name + "=" + value;

      for ( var propName in options ) {

        updatedCookie += "; " + propName;

        var propValue = options[ propName ];

        if ( propValue !== true ) {

          updatedCookie += "=" + propValue;

        }

      }

      document.cookie = updatedCookie;

    }

Does this mean that the version CC2014 "cookie" does not work as it should?

Can I do something wrong?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 18, 2016 Aug 18, 2016
LATEST

Instead of "cookies" is better to use Storage object.

It is much more convenient and works in any version of CC-Illustrator.

Maybe this topic is in the wrong section.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines