Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Strange Cookie

    In my ASP application, I am giving provisions to my users to search for
    products based on the criteria furnished by them. I am doing this by making
    the search Form post to itself & then redirecting the user to the page which
    will display the items they had searched for. For e.g. if the search page is
    named Search.asp & the page which displays the searched item is
    Products.asp, then after the user provides his criteria in Search.asp & then
    clicks the 'Submit' button, the user comes back to Search.asp after which
    they are redirected to Products.asp. Products.asp is the page which finally
    retrieves the product information from the database. In order to display the
    relevant products, I am creating a cookie which will store the WHERE clause
    for the SQL query that will be used in Products.asp. This is how I create
    the cookie to store the WHERE clause:

    <%
    ...................
    strWhereClause=" Items.Price=" & Request.Form("txtPrice")
    Response.Cookies("Search")("WhereClause")=strWhere Clause
    ...................
    %>

    & this is how Products.asp retrieves the products:

    <%
    strSQL="SELECT.......................WHERE " &
    Request.Cookies("Search")("WhereClause") & " ORDER BY..........."
    %>

    Everything works out fine but the baffling point is when I open the
    Temporary Internet Files folder (I am working on Windows 2000 Professional),
    I find that the cookie which should have been created is not present in the
    TIF folder i.e. no new cookie gets created!! How come this is possible? Let
    me repeat that Products.asp retrieves the correct recordset depending on the
    search criteria given by the user but I don't find the cookie anywhere!!!

    Thanks,

    Arpan


    Arpan Guest

  2. Similar Questions and Discussions

    1. Cookies set one time, I delete cookie, cookie is never set again!
      I am having this problem: My PHP script will set a cookie, it's there in my /Cookies folder. I delete the cookie (I have to for testing purposes,...
    2. Strange cookie behavior
      Maybe the remote server is in a different time zone. Ray at work -- Will trade ASP help for SQL Server help "AHN" <anerse@excite.com>...
    3. authentication cookie vs session cookie
      Hi, What are the differences between authentication and session cookies? In my web.config file, I set the cookieless attribute for the...
    4. #24713 [Opn->Bgs]: strange cookie behaviour
      ID: 24713 Updated by: sniper@php.net Reported By: napalm at spiderfish dot net -Status: Open +Status: ...
    5. #24713 [NEW]: strange cookie behaviour
      From: napalm at spiderfish dot net Operating system: redhat linux PHP version: 4.3.2 PHP Bug Type: Unknown/Other Function...
  3. #2

    Default Re: Strange Cookie

    There are two types of cookies.

    Session cookies, and persistant cookies

    Session cookies (not be confused with ASP sessions) are "in-memory" cookies.
    They are stored in the browser's memory space, and are only valid for as
    long as the browser's process is running. When the user closes the browser,
    the cookie is destroyed.

    Persistant cookies are written to the user's hard disk. To make a cookie
    persistant you need to set an expiry date on the cookie. If you do not set
    an expiry date, then the cookie is treated as a sesion cookie.

    Cheers
    Ken

    "Arpan" <arpan_de@hotmail.com> wrote in message
    news:eViT4k3kDHA.2312@TK2MSFTNGP12.phx.gbl...
    : In my ASP application, I am giving provisions to my users to search for
    : products based on the criteria furnished by them. I am doing this by
    making
    : the search Form post to itself & then redirecting the user to the page
    which
    : will display the items they had searched for. For e.g. if the search page
    is
    : named Search.asp & the page which displays the searched item is
    : Products.asp, then after the user provides his criteria in Search.asp &
    then
    : clicks the 'Submit' button, the user comes back to Search.asp after which
    : they are redirected to Products.asp. Products.asp is the page which
    finally
    : retrieves the product information from the database. In order to display
    the
    : relevant products, I am creating a cookie which will store the WHERE
    clause
    : for the SQL query that will be used in Products.asp. This is how I create
    : the cookie to store the WHERE clause:
    :
    : <%
    : ..................
    : strWhereClause=" Items.Price=" & Request.Form("txtPrice")
    : Response.Cookies("Search")("WhereClause")=strWhere Clause
    : ..................
    : %>
    :
    : & this is how Products.asp retrieves the products:
    :
    : <%
    : strSQL="SELECT.......................WHERE " &
    : Request.Cookies("Search")("WhereClause") & " ORDER BY..........."
    : %>
    :
    : Everything works out fine but the baffling point is when I open the
    : Temporary Internet Files folder (I am working on Windows 2000
    Professional),
    : I find that the cookie which should have been created is not present in
    the
    : TIF folder i.e. no new cookie gets created!! How come this is possible?
    Let
    : me repeat that Products.asp retrieves the correct recordset depending on
    the
    : search criteria given by the user but I don't find the cookie anywhere!!!
    :
    : Thanks,
    :
    : Arpan
    :
    :


    Ken Schaefer Guest

  4. #3

    Default Re: Strange Cookie

    Thanks, Ken, for your reply. Yeah, I hadn't set the expiry date for the
    cookie. So it definitely must have been stored in the browser's memory space
    as a session cookie.

    Thanks once again,

    Regards,

    Arpan

    "Ken Schaefer" <kenREMOVE@THISadOpenStatic.com> wrote in message
    news:ONhvnMGlDHA.2432@TK2MSFTNGP10.phx.gbl...
    > There are two types of cookies.
    >
    > Session cookies, and persistant cookies
    >
    > Session cookies (not be confused with ASP sessions) are "in-memory"
    cookies.
    > They are stored in the browser's memory space, and are only valid for as
    > long as the browser's process is running. When the user closes the
    browser,
    > the cookie is destroyed.
    >
    > Persistant cookies are written to the user's hard disk. To make a cookie
    > persistant you need to set an expiry date on the cookie. If you do not set
    > an expiry date, then the cookie is treated as a sesion cookie.
    >
    > Cheers
    > Ken
    >
    > "Arpan" <arpan_de@hotmail.com> wrote in message
    > news:eViT4k3kDHA.2312@TK2MSFTNGP12.phx.gbl...
    > : In my ASP application, I am giving provisions to my users to search for
    > : products based on the criteria furnished by them. I am doing this by
    > making
    > : the search Form post to itself & then redirecting the user to the page
    > which
    > : will display the items they had searched for. For e.g. if the search
    page
    > is
    > : named Search.asp & the page which displays the searched item is
    > : Products.asp, then after the user provides his criteria in Search.asp &
    > then
    > : clicks the 'Submit' button, the user comes back to Search.asp after
    which
    > : they are redirected to Products.asp. Products.asp is the page which
    > finally
    > : retrieves the product information from the database. In order to display
    > the
    > : relevant products, I am creating a cookie which will store the WHERE
    > clause
    > : for the SQL query that will be used in Products.asp. This is how I
    create
    > : the cookie to store the WHERE clause:
    > :
    > : <%
    > : ..................
    > : strWhereClause=" Items.Price=" & Request.Form("txtPrice")
    > : Response.Cookies("Search")("WhereClause")=strWhere Clause
    > : ..................
    > : %>
    > :
    > : & this is how Products.asp retrieves the products:
    > :
    > : <%
    > : strSQL="SELECT.......................WHERE " &
    > : Request.Cookies("Search")("WhereClause") & " ORDER BY..........."
    > : %>
    > :
    > : Everything works out fine but the baffling point is when I open the
    > : Temporary Internet Files folder (I am working on Windows 2000
    > Professional),
    > : I find that the cookie which should have been created is not present in
    > the
    > : TIF folder i.e. no new cookie gets created!! How come this is possible?
    > Let
    > : me repeat that Products.asp retrieves the correct recordset depending on
    > the
    > : search criteria given by the user but I don't find the cookie
    anywhere!!!
    > :
    > : Thanks,
    > :
    > : Arpan
    > :
    > :
    >
    >

    Arpan Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139