469,903 Members | 1,679 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

creating a new cookie


I have an asp page where i created cookies-for admin and for user. The
aspx page reads these cookies. Everything seems to work fine but now i
have to create a new cookie if cookie has expired or if cookie is
null. Also, i am having problems with the expire because if the
username belongs to the admin for example and then i want to change
the username that belongs to a normal user the cookie recognises the
first (admin) cookie. How do i solve this?
if ACCESS="user" then
'--create user cookie
Response.Cookies("UserCookie")("Username") =
Response.Cookies ("UserCookie")("Password")=Request.Form
Response.Cookies("UserCookie").Path = "/"
Response.Cookies ("UserCookie").expires = DateAdd("d", Date, 14)
Response.Write(Request.Cookies("UserCookie")("User name"))
Response.Write (Request.Cookies("UserCookie")("Password"))

'---end user cookie
'create admin cookie

Response.Cookies("adminCOOKIE")("ADMINusername") =
Response.Cookies ("adminCOOKIE")("ADMINPassword")=Request.Form
Response.Cookies("adminCOOKIE").Path = "/"
Response.Cookies ("adminCOOKIE").expires =dateadd("m",20,now())
Response.Write(Request.Cookies("adminCOOKIE")("ADM INusername"))
Response.Write (Request.Cookies("adminCOOKIE")("ADMINPassword"))

'---end admin cookie
end if
end if
Jul 19 '05 #1
0 1922

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by brettr | last post: by
4 posts views Thread by socialism001 | last post: by
9 posts views Thread by Marco Krechting | last post: by
6 posts views Thread by Jerry Spence1 | last post: by
3 posts views Thread by Kelicula | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.