check if the cookie has comma

Hi,
I have created a cookie with value 10.254.124.523,22
  <cfcookie name="User" value="10.254.124.523,22" expires="30">  
How can I say if the cookie value has comma then do something else don't do anything

<cfif cookie.User eq "the value has comma">
do something
<cfelse>
don't do anything
</cfif>
lulu50Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

 
gdemariaCommented:
<cfif cookie.User contains ",">
  do something
<cfelse>
  don't do anything
</cfif>
0
 
gdemariaCommented:
But if you want to find out if there is an actual value on both sides of the comma, you can do this...

<cfif listLen(cookie.user) gt 1>

If the value happens to be ...

"12.345,"   --- there is not value after the comma

or

",12.345"  -- -there is no value before the comma

using the listLen() function will consider that ONE value,  not TWO


If you don't care if there is a value on both sides or not, use my first post

0

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 
lulu50Author Commented:
GOOD JOB!!!!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.