C
collie
Hi,
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?
Thanks
if ACCESS="user" then
'--create user cookie
Response.Cookies("UserCookie")("Username") =
Request.Form("UserName")
Response.Cookies ("UserCookie")("Password")=Request.Form
("Password")
Response.Cookies("UserCookie").Path = "/"
Response.Cookies ("UserCookie").expires = DateAdd("d", Date, 14)
Response.Write(Request.Cookies("UserCookie")("Username"))
Response.Write (Request.Cookies("UserCookie")("Password"))
'---end user cookie
else
'create admin cookie
Response.Cookies("adminCOOKIE")("ADMINusername") =
Request.Form("UserName")
Response.Cookies ("adminCOOKIE")("ADMINPassword")=Request.Form
("Password")
Response.Cookies("adminCOOKIE").Path = "/"
Response.Cookies ("adminCOOKIE").expires =dateadd("m",20,now())
Response.Write(Request.Cookies("adminCOOKIE")("ADMINusername"))
Response.Write (Request.Cookies("adminCOOKIE")("ADMINPassword"))
'---end admin cookie
end if
end if
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?
Thanks
if ACCESS="user" then
'--create user cookie
Response.Cookies("UserCookie")("Username") =
Request.Form("UserName")
Response.Cookies ("UserCookie")("Password")=Request.Form
("Password")
Response.Cookies("UserCookie").Path = "/"
Response.Cookies ("UserCookie").expires = DateAdd("d", Date, 14)
Response.Write(Request.Cookies("UserCookie")("Username"))
Response.Write (Request.Cookies("UserCookie")("Password"))
'---end user cookie
else
'create admin cookie
Response.Cookies("adminCOOKIE")("ADMINusername") =
Request.Form("UserName")
Response.Cookies ("adminCOOKIE")("ADMINPassword")=Request.Form
("Password")
Response.Cookies("adminCOOKIE").Path = "/"
Response.Cookies ("adminCOOKIE").expires =dateadd("m",20,now())
Response.Write(Request.Cookies("adminCOOKIE")("ADMINusername"))
Response.Write (Request.Cookies("adminCOOKIE")("ADMINPassword"))
'---end admin cookie
end if
end if