Darned #$@! Cookies

Results 1 to 2 of 2

Thread: Darned #$@! Cookies

  1. #1
    Join Date
    Dec 1969

    Default Darned #$@! Cookies

    I have a web app that just needs a minor amount of security.<BR>So I have developed a page for each user to log in and check their login name to their supplied password.<BR><BR>If they succeed, then I&#039;d like to store the username in a cookie so that they don&#039;t need to log in again the next time they visit the site.<BR><BR>With this cookie saved, I can then change data relevant only to them.<BR><BR>Here is how I&#039;m attempting to save the cookie data:<BR><BR>Response.Cookies("ANFL_LOGIN_ID").Val ue = lstLoginTeam.SelectedItem.Text<BR><BR>Response.Coo kies("ANFL_LOGIN_ID").Expires = DateTime.Now.AddMonths(6)<BR><BR>Response.Redirect ("FootballMain.aspx")<BR><BR>On the FootballMain.aspx page I can then access the cookie if I use REQUEST.Cookies.("ANFL_LOGIN_ID").Value and everything seemed fine.<BR><BR>However, when I next restart the application, the cookie is completely gone...<BR><BR>Does this have anything to do with my running the app in debug? or am I just setting things up incorrectly.<BR><BR>Thanks for any help,<BR>Eddie<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Darned #$@! Cookies

    well first up Response.Redirect and cokies don&#039;t mix :<BR><BR>http://rtfm.atrax.co.uk/infinitemonkeys/articles/asp/910.asp<BR><BR>and secondly you&#039;ll need to set an expiry date on them, or they&#039;ll die young .<BR><BR><BR>j<BR>http://rtfm.atrax.co.uk/

Posting Permissions

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