I am not familiar enough with classic ASP/VBScript. I have the below code that is working perfectly for my needs.
The below code is checking if my 3 different cookies are empty and inserts the incoming value to the first available. If all those 3 cookies have values, then the script redirects to somepage.
As I wrote before, this code is working fine, but I need some extra work to do: I want also to check IF my incoming value (which is the string productID_from_url
) already exists in any of those 3 cookies' values (because I don’t want duplicate values) and if it exists, then to stop the script and redirect the user to somepage.
I want all of them together without losing the functionality of the below code.Can someone advise me what I have to do?
<%If Request.Cookies("compena") = "" ThenResponse.Cookies("compena")=productID_from_urlResponse.Redirect(url_epistrofis_epi_tixias)ElseIf Request.Cookies("compdyo") = "" ThenResponse.Cookies("compdyo")=productID_from_urlResponse.Redirect(url_epistrofis_epi_tixias)ElseIf Request.Cookies("comptria") = "" ThenResponse.Cookies("comptria")=productID_from_urlResponse.Redirect(url_epistrofis_epi_tixias)ElseResponse.Redirect(url_epistrofis_apo_tixias)End IfEnd IfEnd If%>