Results 1 to 4 of 4

Thread: Switch Content Script set cookie expiration?

  1. #1
    Join Date
    Feb 2011
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Switch Content Script set cookie expiration?

    1) Script Title: Switch Content Script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...tchcontent.htm

    3) Describe problem:
    when setting the persist state to true a cookie is written to remember which tab was left open. when starting a new session this cookie will then attempt to reopen the tab. instead it closes the tab showing nothing. similar to double clicking a tab toggling it. is there a way to set the cookie to be a session cookie so that a default tab's content will show rather than nothing?

    thanks

    stuckagain

  2. #2
    Join Date
    Feb 2011
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    another idea would be to check if the tab is already active and have the script do nothing rather than collapsing the div.

    Any help here?

    thanks

    stuckagain

  3. #3
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Actually the script does support both "session only" and persistent cookies; in the former case, starting a new browser session will reset things and cause just the default expanded content to be expanded when the page first loads. Inside your initialization code, the following line determines which persistence option to use:
    Code:
    bobexample.setPersist(true) //session only
    versus:

    Code:
    bobexample.setPersist(true, 7) //persistent cookie for 7 days
    DD Admin

  4. #4
    Join Date
    Feb 2011
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    confirmed once again - im slow

    thanks for pointing that out!

    stuckagain

Bookmarks

Posting Permissions

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