Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.

View Poll Results: Do you use other ways to persist data other than cookie?

Voters
4. You may not vote on this poll
  • Yes

    3 75.00%
  • No,I use only cookies

    1 25.00%
Results 1 to 13 of 13
  1. #1
    Regular Coder
    Join Date
    Nov 2003
    Location
    Code Heaven
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Do you use other ways for persistence other than cookie?

    And I don't mean hte other `traditional' ways like URL manipulation,or hidden form fields...

    There are other ways to persist data other than cookies,these apply in IE,and they are implemented as behaviors;they are:
    saveFavorite
    saveHistory
    saveSnapshot
    userData(this one reffers to some XML stuff)
    Last edited by Code Wizard; 01-02-2004 at 01:53 PM.

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    It is called server side language with a database.

    [edit if I remember correctly]
    IE only with ActiveX with writing to text file
    [/edit]
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    Regular Coder
    Join Date
    Nov 2003
    Location
    Code Heaven
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ...

    D'OH I forgot to say that this poll refers to client-side scripting not server side...

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ...

    Originally posted by Code Wizard
    D'OH I forgot to say that this poll refers to client-side scripting not server side...
    If you don't use server-side then you're limited to cookies for anything you want to be able to keep past the current session. If the current session is the only need you can add form fields and the URL itself as possible storage locations.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #5
    Regular Coder
    Join Date
    Jul 2003
    Location
    Massachusetts
    Posts
    472
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The window object's name property.

    http://www.webxpertz.net/forums/show...threadid=26736

  • #6
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    If you are using frames, modifying window.name might affect page targetting.

    A much better solution is to use window.navigator object instead:
    Code:
    <html>
    <head>
    <script type="text/javascript">
    window.navigator.num=(window.navigator.num) ? window.navigator.num+1:1;
    alert(window.navigator.num);
    </script>
    </head>
    <body>
    Refresh the page to see that variables persist.
    </body>
    </html>

  • #7
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Moreover, you can create persistent arrays:
    Code:
    <html>
    <head>
    <script type="text/javascript">
    window.navigator.num=(window.navigator.num) ? window.navigator.num+1:1;
    if (window.navigator.arr && window.navigator.arr.length>=0) 
      window.navigator.arr[window.navigator.arr.length]=window.navigator.num;
    else
     window.navigator.arr = new Array();
    
    var temp='';
    for (var i=0;i<navigator.arr.length;i++){
     temp += navigator.arr[i] + '\n';
    }
    alert(temp);
    </script>
    </head>
    <body>
    Refresh the page to see that variables persist.
    </body>
    </html>

  • #8
    Regular Coder
    Join Date
    Jul 2003
    Location
    Massachusetts
    Posts
    472
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Even better, didn't even think of that Glenn.

  • #9
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    glenngv,

    Does that work in all browsers or just a select few?
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #10
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    Tested with all the browsers in my machine - IE5.5, NS7.02, NS4.78 and Mozilla 1.0 and it all works except for NS7.

  • #11
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Does anyone else find this just a little disconcerting, or is it just me?

    Somebody should check in Mozilla 1.4+. Wouldn't surprise me if this was removed in 1.01 and greater (NS7) simply due to the very iffy reach beyond the sandbox this has.

    If it persisted, you could do ugly stuff like:

    navigator.__defineGetter__("userAgent", function() {
    // do code to steal cookies and submit a form or something
    });

    Or anything like that.

  • #12
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Moz 1.4 rejects it.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #13
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by jkd
    Does anyone else find this just a little disconcerting, or is it just me?
    No it's not just you
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •