Results 1 to 3 of 3

Thread: Cookies

  1. #1
    Join Date
    Dec 1969

    Default Cookies

    How can I get a cookie to delete its self when you close the browser?<BR>thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: Cookies

    When you create the cookie, don&#039t set its expires property. So, if I wanted to create a cookie that would be deleted when the browser is closed, I do:<BR><BR>Response.Cookies("CookieName")("KeyName ") = SomeValue<BR><BR>AND THAT&#039S IT! No:<BR>Response.Cookies("CookieName").Expires = ...<BR><BR>Hope this helps!

  3. #3
    Hema S Guest

    Default RE: Cookies

    Hi all,<BR>I have a slightly diff problem :<BR> Well, I have the user login & try to store a cookie on the next page..this cookie gets created and is accessible in the next form. But if I close the browser, it should retain the cookie the next time the form is loaded..but the cookie disappears! <BR>I&#039m thinking of a suitable alternative for this, but at the same time am flummoxed as to why this is happenning..<BR> Also, I&#039ve alternately added & removed the .Expires property just to make sure. Here&#039s my code :<BR><BR>login.asp - Submits to password.asp :<BR>&#039 read cookie<BR>usrname = Request.Cookies("Logincookie")<BR>&#039 this doesn&#039t come up with anything ! <BR>Response.Write usrname <BR><BR>password.asp <BR>&#039 create cookie..gets created from &#039login&#039 field of login.asp<BR><BR>Response.Cookies("Logincookie") = Request.Form("login")<BR>Response.Cookies("User")( "Logincookie").Expires = "Apr 1, 2004"<BR><BR> Also, if i&#039m creating more than one cookies (in different forms), do i need to creatre a cookie dictionary or can i just create them normally? <BR>Can anyone help??<BR>Thanks a ton,<BR>Hema

Posting Permissions

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