setting and reading a cookie?

Results 1 to 2 of 2

Thread: setting and reading a cookie?

  1. #1
    Join Date
    Dec 1969

    Default setting and reading a cookie?

    I&#039ve created a form where someone can log in. The page that receives the info from the form sets a cookie on the machine. I would like for the person to be able to already have the text box for username filled in upon returning. So on the form where they log in, I&#039m saying<BR><BR>var = request.cookies("mycookie")("username")<BR><BR>&#0 60;input type="text" name="username" value="&#060;%=var%&#062;"&#062;<BR><BR>This is not working. Can anyone shed some light on these delicious things we call cookies:? Thanks.

  2. #2
    Josh Rolfe Guest

    Default RE: setting and reading a cookie?

    When you set your cookie, make sure you specify an expiration date. Otherwise, it is only good for the length of the session.<BR><BR>Use<BR>response.cookies("mycookie" )("username")=request("username")<BR>response.cook ies("mycookie").expires=Date+365<BR><BR>This will make your cookie persist on the client computer for one year.

Posting Permissions

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