Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session Recognition: The ugly beast roars again...

Status
Not open for further replies.

fusionaire

Programmer
May 20, 2000
67
US
I have included the orignal letter below just in case anyone needs a brush up...<br><br>I have successfully added the ?cfid=#cfid#&cftoken=#cftoken#<br>to all the links within the site with no problem except for one.....<br><br>I still get the exact same CFID & CFTOKEN number everytime I try testing the application. So, I then added SessionTimeout=&quot;#CreateTimeSpan(0,0,3,0)#&quot;, so that after three minutes of doing nothing, the session should be reset correct? <br><br>I also have set in the Application a CFSET that reads:<br>&lt;CFSET Session.SessionID=&quot;#CFID##CFTOKEN#&quot;&gt;<br>I then use that number for the ordernumber if and when a user would want to make a purchase. So..<br><br>WHAT AM I DOING WRONG???<br><br>Any advice, help or slaps in the face are welcome...<br><br><br>------ORIGINAL LETTER-----------------<br><br>what I was wondering, was if someone<br>could explain exactly how you set up the session variables and also how<br>you<br>&nbsp;reference them throughout the application. I am a newbie, and I have yet<br>to<br>find a single resource that clearly explains this.<br><br>&nbsp;I am building a shopping cart application, and I have Session management<br>on,<br>&nbsp;and client management off, So, even though I can still get the CFID,<br>CFTOKEN<br>&nbsp;and URLTOKEN within my Session scopes, how can I set it so that a user who<br>&nbsp;orders a product at one session, could come back the next day and order<br>some<br>&nbsp;more products without getting the same CFID,CFTOKEN and URLTOKEN?<br><br>&nbsp;That is my problem. I am totally clueless on what to do for that. <br>&nbsp;NOTE:I do have a &quot;reciept&quot; page that is supposed to reset all session<br>variables, but whenever I get back on the site, I recieve the same CFID<br>and<br>&nbsp;CFTOKEN. This is persistant even though I test the site daily, since I<br>started this site about two weeks ago, I still have the exact same number.<br>&nbsp;The reason I want to do it this way is because the we want the sessionID<br>to<br>be the order number.<br><br>&nbsp;Any advice you can give will be much appreciated.<br><br>&nbsp;<br><br><br>Was this post helpful?<br>Vote fusionaire TipMaster!<br>&nbsp;<br><br>Is this post offensive?<br>If so, Red Flag it!<br>&nbsp;<br><br>Check out the FAQ<br>area for this forum!<br>&nbsp;<br>&nbsp;<br>DarkMan (Programmer) May 24, 2000 <br>Your problem is probably that CF is setting a cookie on the client's browser and using it next time around.&nbsp;&nbsp;As long as you have<br><br>?cfid=#cfid#&cftoken=#cftoken#<br><br>at the end of ALL of your links within the site, you can turn the cookies off.<br><br>In your application.cfm file, in your &lt;cfapplication&gt; tag, use the parameter SETCLIENTCOOKIES=&quot;No&quot;.&nbsp;&nbsp;Be careful, though.&nbsp;&nbsp;If you don't have the cfid and cftoken appended to all the links within your site, the session settings will be lost....&nbsp;&nbsp;<br>&nbsp;<br>
 
Did you use the SETCLIENTCOOKES=&quot;NO&quot; in your &lt;CFAPPLICATION&gt; tag in your Application.cfm file?<br><br>I still think CF is reading a cookie in your browser....
 
I learned how to do this today from another forum. Not sure if this is what you wanted by try it.<br><br>On your application.cfm, have the following...<br><br>&lt;CFAPPLICATION NAME=&quot;MyApp&quot; CLIENTMANAGEMENT=&quot;Yes&quot; SESSIONMANAGEMENT=&quot;Yes&quot; SESSIONTIMEOUT=&quot;#CreateTimeSpan(0,0,30,0)#&quot; APPLICATIONTIMEOUT=&quot;#CreateTimeSpan(1,0,0,0)#&quot;&gt;<br><br>&lt;!-- This is the impt part. Set Sessions to expire when browser is closed --&gt;<br>&lt;CFCOOKIE NAME=&quot;CFID&quot; VALUE=&quot;#Session.CFID#&quot;&gt;<br>&lt;CFCOOKIE NAME=&quot;CFToken&quot; VALUE=&quot;#Session.CFToken#&quot;&gt;<br><br><br>If you want to delete the session variables, plus CFID & CFToekn when logging out, have this in your logout page.<br><br>&lt;CFSCRIPT&gt; StructClear(Session); &lt;/CFSCRIPT&gt;<br>&lt;CFCOOKIE NAME=&quot;CFID&quot; VALUE=&quot;0&quot; EXPIRES=&quot;NOW&quot;&gt;<br>&lt;CFCOOKIE NAME=&quot;CFTOKEN&quot; VALUE=&quot;0&quot; EXPIRES=&quot;NOW&quot;&gt;<br><br>Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top