Help understanding Cookies Please!

Discussion in 'JavaScript' started by xnarutogodx, Nov 23, 2009.

  1. #1
    // set
    Cookie.set("language", "en", {path: "/", duration: 365});

    // read it into a var
    var language = Cookie.get("language");

    // remove it.
    Cookie.remove("language");

    How do I use for example // set
    Cookie.set("language", "en", {path: "/", duration: 365})
    Do I put this in a hyperlink or anywhere in the page?Is this suppose to be in hyperlinks? Ex:<a href="something with cookies
    To remove it how do I put in a href?



    This is the format I'm going to have for the to language.
    <a href="http://en.mysite.com/" title="English"><strong>English</strong> - continue</a>
    Any help will be greatly appreciated.
     
    xnarutogodx, Nov 23, 2009 IP
  2. shubhamjain

    shubhamjain Active Member

    Messages:
    215
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    63
    #2
    Could you be more clear on what you want. I wasnt able to understand your query.
     
    shubhamjain, Nov 23, 2009 IP
  3. gandalf117

    gandalf117 Active Member

    Messages:
    111
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3
    you have to use a server-side scripting language such as ASP.NET, JAVA or PHP to use cookies. You can't just put it in a hyperlink or just anywhere on the page :) You must use a language other than HTML.

    try googling "cookies in ASP.NET" for example and you will get plenty of tutorials on how they are set, retrieved and removed. It's not too hard and you don't have to know the whole language to do it, but you will need an environment that runs ASP.NET
     
    gandalf117, Nov 25, 2009 IP