User-1174608757 posted
Hi doug@soft-factory.com,
According to your code, sub put_cookie_string is used to check the cookie PROGRAM_COOKIE_NAME is null or not, if it is null then add , if it is not null , then its subkey and value will be covered. It seems no problem however you set the cookie time
as 50 years,we normally don't set the cookie as this , if you want store cookie permanently,I suggest you to write as below:
Response.Cookies( PROGRAM_COOKIE_NAME).Expires = DateTime.MaxValue;
Then for function get_cookie_string, this function has some problem.Since get_cookie_string is defined in the function ,you should return get_cookie_string in the end ,else it is meaningless. You should write as below:
Function get_cookie_string(ByVal subkeyName)
get_cookie_string = ""
If (Request.Cookies(PROGRAM_COOKIE_NAME) IsNot Nothing) Then
If (Request.Cookies(PROGRAM_COOKIE_NAME)(subkeyName) IsNot Nothing) Then
get_cookie_string = Request.Cookies(PROGRAM_COOKIE_NAME)(subkeyName)
Return get_cookie_string
End If
End If
End Function
Best Regards
Wei Zhang