SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Cookie path??

  1. #1
    SitePoint Evangelist tangledman's Avatar
    Join Date
    Sep 2005
    Location
    Puerto de Mazarron, Murcia, Spain
    Posts
    425
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cookie path??

    Is it possible to set a cookie at www.domain.com/cookie

    Code ASP:
    <%
    'create the cookie
    Response.Cookies("Will") = "Hello Mr Cookie"
    %>


    and read it from www.domain.com?

    Where do I specify the path to write and where do I specify the path to read it?

  2. #2
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,629
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    If you set the cookie at the /cookie level and do not define the Path, then only pages in /cookie (and below) will be able to get it. However if you set it with the root path then all pages within the website will be able to get it.

    Code ASP:
    <%
    'create the cookie
      Response.Cookies("Will") = "Hello Mr Cookie"
      Response.Cookies("Will").Path = "/"
    %>
    Ian Anderson
    www.siteguru.co.uk

  3. #3
    SitePoint Evangelist tangledman's Avatar
    Join Date
    Sep 2005
    Location
    Puerto de Mazarron, Murcia, Spain
    Posts
    425
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. That solved it.


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
  •