problem with cookie

can't get my cookie to set

Page 1 of 1

5 Replies - 3666 Views - Last Post: 26 September 2007 - 12:07 PM Rate Topic: -----

#1 lezlieao   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 26-September 07

problem with cookie

Posted 26 September 2007 - 11:18 AM

I know I'm probably dumb but I cannot get this cookie to set.

	
   <cfset reco= "#access.recordcount#">
   <cfif reco is "0">
   <cflocation url="log_in.cfm">
   
   <cfelse>
	
	<cfif IsDefined("prog_id")>
	<cfcookie name = "prog_id" value = "#contacts.prog_id#">
	<cfheader name= "refresh" value="0; url=memarea.cfm">



   </cfif>
</cfif>




Is This A Good Question/Topic? 0
  • +

Replies To: problem with cookie

#2 supersssweety   User is offline

  • D.I.C Regular
  • member icon

Reputation: 22
  • View blog
  • Posts: 373
  • Joined: 16-March 07

Re: problem with cookie

Posted 26 September 2007 - 11:20 AM

View Postlezlieao, on 26 Sep, 2007 - 11:18 AM, said:

I know I'm probably dumb but I cannot get this cookie to set.

	
   <cfset reco= "#access.recordcount#">
   <cfif reco is "0">
   <cflocation url="log_in.cfm">
   
   <cfelse>
	
	<cfif IsDefined("prog_id")>
	<cfcookie name = "prog_id" value = "#contacts.prog_id#">
	<cfheader name= "refresh" value="0; url=memarea.cfm">



   </cfif>
</cfif>




What does your application file look like? Where is contacts.prog_id coming from? Did you try cfdump right after you made the cookie to see what is in there?

This post has been edited by supersssweety: 26 September 2007 - 11:24 AM

Was This Post Helpful? 0
  • +
  • -

#3 lezlieao   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 26-September 07

Re: problem with cookie

Posted 26 September 2007 - 11:34 AM

View Postsupersssweety, on 26 Sep, 2007 - 11:20 AM, said:

View Postlezlieao, on 26 Sep, 2007 - 11:18 AM, said:

I know I'm probably dumb but I cannot get this cookie to set.

	
   <cfset reco= "#access.recordcount#">
   <cfif reco is "0">
   <cflocation url="log_in.cfm">
   
   <cfelse>
	
	<cfif IsDefined("prog_id")>
	<cfcookie name = "prog_id" value = "#contacts.prog_id#">
	<cfheader name= "refresh" value="0; url=memarea.cfm">



   </cfif>
</cfif>




What does your application file look like? Where is contacts.prog_id coming from? Did you try cfdump right after you made the cookie to see what is in there?



The database I'm working with is called contacts and the column that i need to cookie is prog_id. Problem is, my contact with the database is limited and I can't get in there to change or look at stuff. This is basically what i need it to be able to do...
		<cfif IsDefined("cookie.prog_id")>
		</cfif>
		<cfif cookie.prog_id is "SC">
		  <div align="center"><br>
			<cfinclude template="study_collabor.cfm">
			<br>
		  </div>
		</cfif>


Was This Post Helpful? 0
  • +
  • -

#4 supersssweety   User is offline

  • D.I.C Regular
  • member icon

Reputation: 22
  • View blog
  • Posts: 373
  • Joined: 16-March 07

Re: problem with cookie

Posted 26 September 2007 - 11:43 AM

View Postlezlieao, on 26 Sep, 2007 - 11:34 AM, said:

The database I'm working with is called contacts and the column that i need to cookie is prog_id. Problem is, my contact with the database is limited and I can't get in there to change or look at stuff. This is basically what i need it to be able to do...
		<cfif IsDefined("cookie.prog_id")>
		</cfif>
		<cfif cookie.prog_id is "SC">
		  <div align="center"><br>
			<cfinclude template="study_collabor.cfm">
			<br>
		  </div>
		</cfif>



Hrm, the only way I have worked with data from a database is through queries. I have never seen where you can just refer to data in a variable like #tablename.column# I always make a query that finds this first and then the variable would be #queryname.column#

Do you have a query? Is that what access is? Still need a little more info
Was This Post Helpful? 0
  • +
  • -

#5 lezlieao   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 26-September 07

Re: problem with cookie

Posted 26 September 2007 - 12:02 PM

View Postsupersssweety, on 26 Sep, 2007 - 11:43 AM, said:

View Postlezlieao, on 26 Sep, 2007 - 11:34 AM, said:

The database I'm working with is called contacts and the column that i need to cookie is prog_id. Problem is, my contact with the database is limited and I can't get in there to change or look at stuff. This is basically what i need it to be able to do...
		<cfif IsDefined("cookie.prog_id")>
		</cfif>
		<cfif cookie.prog_id is "SC">
		  <div align="center"><br>
			<cfinclude template="study_collabor.cfm">
			<br>
		  </div>
		</cfif>



Hrm, the only way I have worked with data from a database is through queries. I have never seen where you can just refer to data in a variable like #tablename.column# I always make a query that finds this first and then the variable would be #queryname.column#

Do you have a query? Is that what access is? Still need a little more info



This is the full page. So I am using access as my query, and I changed my variable to access.prog_id but that still wouldn't make this cookie set right, because I disn't refer back to it.
<cfif IsDefined("Form.entersqt") is True>
   <cfquery name="access" datasource="sqt_access">
   	SELECT uid, passwd, prog_id
   	FROM contacts 
   	WHERE uid= '#form.uname#' AND passwd= '#form.passwd#'
   </cfquery>
   
   <cfset reco= "#access.recordcount#">
   <cfif reco is "0">
   <cflocation url="log_in.cfm">
   
   <cfelse>
	
	<cfif IsDefined("prog_id")>
	<cfcookie name = "prog_id" value = "#access.prog_id#">
	<cfheader name= "refresh" value="0; url=memarea.cfm">


   </cfif>
</cfif>
</cfif>


[quote name='lezlieao' post='260314' date='26 Sep, 2007 - 11:59 AM']
[quote name='supersssweety' post='260309' date='26 Sep, 2007 - 11:43 AM']
[quote name='lezlieao' post='260305' date='26 Sep, 2007 - 11:34 AM']
The database I'm working with is called contacts and the column that i need to cookie is prog_id.  Problem is, my contact with the database is limited and I can't get in there to change or look at stuff.  This is basically what i need it to be able to do...
[code]

		<cfif IsDefined("cookie.prog_id")>
		</cfif>
		<cfif cookie.prog_id is "SC">
		  <div align="center"><br>
			<cfinclude template="study_collabor.cfm">
			<br>
		  </div>
		</cfif>


[/quote]

Hrm, the only way I have worked with data from a database is through queries. I have never seen where you can just refer to data in a variable like #tablename.column# I always make a query that finds this first and then the variable would be #queryname.column#

Do you have a query? Is that what access is? Still need a little more info
[/quote]


This is the full page. So I am using access as my query, and I changed my variable to access.prog_id but that still wouldn't make this cookie set right, because I disn't refer back to it.
[code]
<cfif IsDefined("Form.entersqt") is True>
<cfquery name="access" datasource="sqt_access">
SELECT uid, passwd, prog_id
FROM contacts
WHERE uid= '#form.uname#' AND passwd= '#form.passwd#'
</cfquery>

<cfset reco= "#access.recordcount#">
<cfif reco is "0">
<cflocation url="log_in.cfm">

<cfelse>

<cfif IsDefined("prog_id")>
<cfcookie name = "prog_id" value = "#access.prog_id#">
<cfheader name= "refresh" value="0; url=memarea.cfm">


</cfif>
</cfif>
</cfif>
[/quote]


NEVERMIND.. You were right and I was trying to define something that did not exist. Thanks for your help!!
Was This Post Helpful? 0
  • +
  • -

#6 supersssweety   User is offline

  • D.I.C Regular
  • member icon

Reputation: 22
  • View blog
  • Posts: 373
  • Joined: 16-March 07

Re: problem with cookie

Posted 26 September 2007 - 12:07 PM

anytime
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1