Warning: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in ..../includes/class_bbcode.php on line 2962

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in ..../includes/class_bbcode.php on line 2962

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
How to delete cookies in Javascript?
Results 1 to 6 of 6

Thread: How to delete cookies in Javascript?

  1. #1
    Junior Member
    Join Date
    Jan 2005
    Location
    B.C. Canada
    Posts
    74

    Thumbs up

    Does anyone knows about Javascript?

    Could you tell me how to delete cookies in Javascript?


    :blink:

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

    ---------------------------

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

  2. #2
    Senior Member
    Join Date
    Jan 2005
    Location
    Neer Springfield, MA
    Posts
    443
    Im not sure, will this help?

    Delete Cookie Javascript Function
    // this deletes the cookie when called
    function Delete_Cookie( name, path, domain ) {
    if ( Get_Cookie( name ) ) document.cookie = name + "=" +
    ( ( path ) ? ";path=" + path : "") +
    ( ( domain ) ? ";domain=" + domain : "" ) +
    ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
    }
    Here all you need to do is put in: Delete_Cookie('cookie name', '/', '&#39 and the cookie will be deleted. Remember to match the cookie name, path, and domain to what you have it in Set_Cookie exactly, or you may get some very hard to diagnose errors.

    WARNING: Do not assume the Cookie has actually been deleted during that session, both Opera and IE have in some of their browser versions maintained the cookie until you restart your browser even if you have deleted it in the script. If script functionality depends on the delete action having happened, make sure you do another Get_Cookie test on the deleted cookie to make sure it's actually deleted.

    "If you enjoy what you do, you'll never work another day in your life."

    My man confucius said it well :D

    Why is my signature text blue I did not make it like that??

  3. #3
    Associate
    Join Date
    Feb 2005
    Location
    Leicester, England.
    Posts
    40
    forgive my ignorance but why would you want to delete cookies like that?

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

    Widescreen XP |
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
    |
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
    |
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
    |
    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
    |

  4. #4
    Mentor
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    1,159
    The only thing I can imagine is to create a script file that'll do it for him, perhaps to save time.

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

  5. #5
    Senior Member
    Join Date
    Jan 2005
    Location
    Neer Springfield, MA
    Posts
    443
    I donk actually know anything about/in java. I drink java and that is about the only thing I can say...:lol: I found that on the internet somewhere. Yahoo.com then typed delete cookies in Java. I like to keep it simple (for me anyway )
    "If you enjoy what you do, you'll never work another day in your life."

    My man confucius said it well :D

    Why is my signature text blue I did not make it like that??

  6. #6
    Junior Member
    Join Date
    Jan 2005
    Location
    B.C. Canada
    Posts
    74

    Unhappy

    Originally posted by CoolJsa14@Feb 7 2005, 03:24 PM
    Im not sure, will this help?

    Delete Cookie Javascript Function
    // this deletes the cookie when called
    function Delete_Cookie( name, path, domain ) {
    if ( Get_Cookie( name ) ) document.cookie = name + "=" +
    ( ( path ) ? ";path=" + path : "") +
    ( ( domain ) ? ";domain=" + domain : "" ) +
    ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
    }
    * Here all you need to do is put in: Delete_Cookie('cookie name', '/', '&#39 and the cookie will be deleted. Remember to match the cookie name, path, and domain to what you have it in Set_Cookie exactly, or you may get some very hard to diagnose errors.

    WARNING: Do not assume the Cookie has actually been deleted during that session, both Opera and IE have in some of their browser versions maintained the cookie until you restart your browser even if you have deleted it in the script. If script functionality depends on the delete action having happened, make sure you do another Get_Cookie test on the deleted cookie to make sure it's actually deleted.
    [snapback]3867[/snapback]
    Thank you very much...actually, I got whole bunch of javascript here on my webpage...but I don't understand it...(coz I was just kinda adopted from somewhere from the net.

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

    ---------------------------

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Similar Threads

  1. *bad* cookies
    By trommaster in forum Announcements and Suggestions
    Replies: 18
    Last Post: 11-09-2003, 05:50 PM
  2. JavaScript or PHP?
    By vwgtiturbo in forum Programming
    Replies: 3
    Last Post: 10-30-2003, 11:03 PM
  3. htaccess and cookies
    By coltrane in forum Linux - Software, Applications & Programming
    Replies: 4
    Last Post: 12-27-2002, 06:29 AM
  4. Isn't javascript great?
    By kornp in forum General Chat
    Replies: 3
    Last Post: 12-04-2002, 02:38 AM
  5. No more cookies in Europe
    By cloverm in forum General Chat
    Replies: 13
    Last Post: 11-20-2001, 05:50 AM

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
  •