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.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Setting simple Cookie

    Hi All,

    I am trying to set a simple cookie when a page loads. I am a beginner and all the cookie scripts I have look at are too complicated for what I want.

    I tried

    onLoad="document.cookie = 'CookieName','Value' " but this does not work.

    I want the cookie to last while the user is on the site and once he leaves it must be deleted.

    Am I on the correct path and can anyone help?

    Thanks in advance.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    New York, USA
    Posts
    175
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try:

    onLoad="document.cookie='name=value'"


  •  

    Posting Permissions

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