ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old March 12th, 2005, 04:10 PM
charmed0rz charmed0rz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 142 charmed0rz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 h 49 m 31 sec
Reputation Power: 5
Cookies..

How to tell if one is defined or not.. ?
i tried
<cfif #cookie.x# is ''>
but no go.. how would you do that?

Also i have a field in my database that has numbers in it like: 43,35

how could i take one of the numbers and set it as a cookie, and put the other as another?
ie: #cookie.x# as 43, and #cookie.y# as 35..

Reply With Quote
  #2  
Old March 13th, 2005, 03:42 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
<cfif not structKeyExists( cookie, 'myKey' )>
<cfset cookie.myKey = "whatever">
</cfif>
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old March 13th, 2005, 04:00 PM
charmed0rz charmed0rz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 142 charmed0rz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 h 49 m 31 sec
Reputation Power: 5
Thanks

Quote:
Originally Posted by kiteless
<cfif not structKeyExists( cookie, 'myKey' )>
<cfset cookie.myKey = "whatever">
</cfif>


How am I going to have to do the last part of it? Or should I just use two different fields for the two?

Reply With Quote
  #4  
Old March 13th, 2005, 06:12 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
Yes just set two cookie values. cookie.a = "blah" cookie.b = "foo"

Remember that there are limits to how many cookies you can store as well as the size of the cookies. Don't rely on cookies to store many values or any values of large size.

Reply With Quote
  #5  
Old March 13th, 2005, 08:09 PM
Alas's Avatar
Alas Alas is offline
Wickedwd.com
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: wickedwd.com
Posts: 186 Alas Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 17 h 22 m 55 sec
Reputation Power: 0
I honestly didnt read the whole thread so if this makes no sence "my bad"

Code:
<CFIF IsDefined("COOKIE.mycookie")
do whatever
</CFIF>

the opposite also works

<CFIF not IsDefined("COOKIE.mycookie")
do whatever
</CFIF>


-Alas

Reply With Quote
  #6  
Old March 14th, 2005, 06:35 PM
charmed0rz charmed0rz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 142 charmed0rz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 h 49 m 31 sec
Reputation Power: 5
Ok i'm new.. so please someone tell me why this isn't working.

<CFIF NOT structKeyExists(cookie, "x")>
<cfquery name="get_x" datasource="aeris7282">
Select x from map
where user_id = '#session.user_ID#'
</cfquery>
<cfoutput query="get_x>
<cfcookie name="x" value="#x#">
</cfoutput>
</CFIF>

Reply With Quote
  #7  
Old March 14th, 2005, 07:08 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
Post the error. The code doesn't help at all if you don't explain what is happening.

Reply With Quote
  #8  
Old March 15th, 2005, 02:09 PM
charmed0rz charmed0rz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 142 charmed0rz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 h 49 m 31 sec
Reputation Power: 5
There isnt one. Just nothing is happening..

Quote:
Originally Posted by kiteless
Post the error. The code doesn't help at all if you don't explain what is happening.

Reply With Quote
  #9  
Old March 15th, 2005, 02:32 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
You might try:

<CFIF NOT isDefined( 'cookie.x' )>
...
</cfif>


Can't remember, but cookie might not be treated as a struct.

Reply With Quote
  #10  
Old March 15th, 2005, 02:43 PM
charmed0rz charmed0rz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 142 charmed0rz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 h 49 m 31 sec
Reputation Power: 5
oh wow im embaressed, i forgot an end quote.

Quote:
Originally Posted by kiteless
You might try:

<CFIF NOT isDefined( 'cookie.x' )>
...
</cfif>


Can't remember, but cookie might not be treated as a struct.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Cookies..


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway