Results 1 to 3 of 3

Thread: asp and cookies

  1. #1
    Guest
    Hiyas, I am trying to use cookies on an asp page, and its working, but it only seems to be creating a temp cookie and then as soon as ie is closed the cookie is gone, and when you go back to the page, it can't get the cookie, yet if that ie is open you can go to any page of that site, and it can get the cookie but as soon as that ie closes its gone...

    i am wanting to create a cookie which is saved as a cookie and won't be deleted when that browser is closed, so say the day after unless they have cleared all their cookies the page will be able to access that cookie.

    the way i am trying to create cookies at the moment is:

    <%
    'to save the cookie
    response.cookies("name") = "Fred"

    %>

    and then on another page to get the cookie i might have:

    <%
    dim name
    name = request.cookies("name")
    %>

    Welcome, <%=name%>

    can someone please tell me a way to set a permenant cookie in asp, well until they delete it themselves?

    thanx.

  2. #2
    Lively Member
    Join Date
    Jan 2000
    Posts
    102
    you need to set the expires date, ofcourse.
    <%
    Response.Cookies("name").Expires = expireDate
    %>
    cookies without expire data are indeed deleted
    when ie is closed.

    you might run into some minor difficulties
    figuring out the exact format for the expire date,
    but i'm sure you'll find it.

    goodluck.
    itay.

  3. #3
    Guest
    thanx a million italy it works fine now .

Posting Permissions

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



Click Here to Expand Forum to Full Width