Jump to content

Search the Community

Showing results for tags 'cookie'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 16 results

  1. westman

    cookie coding

    Hi all, I am coding cookies for the first time and here is what I have. setcookie("username", $old_cookie, "1", "/", "", "", TRUE); setcookie("username", $new_cookie, strtotime( '+30 days' ), "/", "", "", TRUE); Is this the right way of resetting the value of one cookie? ps. I did read a lot on http://php.net/manual/en/function.setcookie.php but it is not clear.
  2. I'm just starting to use cookies for personalizing my website and I need a little clarification about the DOM. When a cookie is sent along with the request for a website, does it become available to the whole site (like every page you might load) or just to a specific page included in your website. I am planning on using the setcookie, getcookie and checkcookie functions from w3 - can I put them in any page of the website or do I have to use them from the initial page of my site? Any guidance would be appreciated.
  3. I was wondering if there is any way to set unique values to each cookie. I want to use these cookies on my website to see if the visitor has already visited my website once, but without asking any information from them. This way I want to store this unique value in my database each time someone opens my website, and I will be able to see if there have been - for example - 20 different visitors in the past month, or if the same person has visited my website 20 times. All my code is already written and working, I only need a way to set a different unique value to each cookie I set
  4. I am trying to set a cookie when there is no cookie from my website found on the user's PC, but the following line of code doesn't work inside a function: $cookiename = "test"; $cookievalue = "tests"; setcookie($cookiename, $cookievalue, false, "/", "localhost"); It does work however if it is placed outside of the function. For exampe, the code above works, but the next code doesn't: $cookiename = "test"; $cookievalue = "tests"; function addCookie() { setcookie($cookiename, $cookievalue, false, "/", "localhost"); } addCookie();
  5. I'm trying to erase completely a cookie that is set if a particular URL parameter is present.I've tried: function delete_cookie( name ) {document.cookie = name + '=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;';} And it sets the cookie value to null but the cookie itself or at least the name of the cookie stays in the browser so that when the same URL is opened again, it will not update the cookie value from null to XXX nor is a second cookie with the URL value created.For the new cookie to be setup again I have to right-click on the cookie name (in Chrome) and choose delete. This way t
  6. Hi, I have a button on my page and it links to a page that has a security notice on it, for the user to login the user has to agree that they've read this and then they click on the login in process. Is it possible if the user has read this previously(using cookies) that they are brought to the login page without showing the security page?The process is as follows:1. User clicks login.2. Depending on if the user has clicked "I have read this" the user will be brought to the login page..... if they have not read the message before then they will be brought to the security page.Hope this makes s
  7. Hi everyone. I'm trying to write a cookie for a site I'm working on the displays a page until it triggers an onclick event. I have a section of the site that pulls up a disclaimer page with 2 options one that says I disagree and shoots you to the home page and one that triggers the cookie which if it's started in your browser will redirect you to the section you need to agree to in order to see. I've been able to get it to work upon visit, but I'm not having any luck with the on click event. I've been tweaking the script I found here --> http://www.javascrip...redirect-2.html I feel like I'
  8. CMS/Forum Session/cookie management and security, picking a good example. I am starting an opensource GPL forum project primarily for the sake of learning. I have been looking at the different implementations for user authentication and session management of different CMS and forum packages.Trying to go through and learn what is being done. Also wondering which makes for the best example of a good clean way to implement it.I would prefer to store the bare minimum cookies client side and keep most data in session variables server side.Unless there is a good reason to have another cookie or two,
  9. I was looking through one of my web dev books when I found a javascript function I just didn't get. it was used in a cookie that stored info about radio buttons chosen. the function is escape() and here is the line document.cookie="optFont=" +escape(fontChoice)+";expires="+expire.toUTCString(); can anyone tell me what this function does and some common uses
  10. yoyo w3s...im having a little trouble with my login page... here you can see the example: http://speed-scene.c...scene/login.php anyways, i allready knew about sessions and such, so i was thinking that it was time to expand my knowledge a little. so i was trying to make a login page that was using cookies to log me in, and while expanding, i was thinking that i could try it out on one of my projects on the following link i have allready given. but the trouble is that when im trying to login, then im just staying at the same page, and nofthing by then happends... here is all my login codes/page
  11. dalawh

    Cookies

    I notice that you can check if a cookie is set or retrieve the information if you knew the name, but what happens if the name was dynamic (changing for each person)? Is there no way to retrieve it? Should the name always be dynamic?
  12. Are they the same or are they different?
  13. dalawh

    Cookies

    I was looking at http://www.w3schools.com/js/js_cookies.asp and I was wondering if there was something more detailed on cookies. How do cookies look like? Are they just like a text in a document? If you look at the getCookie function, it only gets one line from the cookie, which I assume is because of the setCookie function only creates 1 line, but isn't a cookie normally larger or are cookies individually defined/created by the web designer and not the browser itself? What does "unescape(y)" do?
  14. hi, i so confused with retrieve the cookie when retrieve the cookie in the other file....i have some file....1. login.php -----> this file have a action form to checklogin.php2. checklogin.php -->cookie usrname to be set and the end of code i put header("location: home.php")3. home.php ---> menu of my website after user login. so i really confused when i retrieve the cookie usrname in the file home.php.....how to retrieve the cookie of usrname into home.php....??i has been try this code :echo $_POST["usrname"]; orecho $_COOKIE["usrname"];but both of this code isn't work..... :fool:
  15. HrBingR

    Cookie Help

    Hello. I'm new to the W3Schools Forums, and I'm relatively new to web developing. I have a question. My website, www.universallinks.co.za, went live not long ago. I'm in the process of developing a mobile version of the website, but I have a small problem. If a user on a mobile device goes to my website, I wish to present them with the opportunity to switch to the main website. It's easy enough to do so, except I don't know how to use cookies. Could anyone on the forum assist me in this matter? My website is primarily coded in HTML, so I hope I've posted in the right section. I did search the
  16. I am trying to save the state of a tree menu by storing the name of the open section in a cookie, and then reading the cookie onload. It seems to be going to the href url before writing to the cookie. Below is my code and some examples of where the functions are used in my page. Thanks in advance for you help. <body id="body" onload="getMenuState()"> <a href="/" onclick="setMenuState('none');">Home</a> <li class="nav" onmouseover="mOvr1(this);" onmouseout="mOut1(this);" onclick="setMenuState('sectionLinks_1')"> <a href="/Security-Camera-System
×
×
  • Create New...