Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / September 2004



Tip: Looking for answers? Try searching our database.

Sesson Variables and Cookies

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
topshark - 28 Sep 2004 21:25 GMT
My site requires several session variables in order for it  to function
properly.    I have just discovered that if the visitor has cookies turned off
on their browser, the site is not working properley.

I didnt think session variables required cookies to be enabled..   is this not
true?
OldCFer - 28 Sep 2004 23:14 GMT
Session management requires cookies, or you have to pass the CFID/CFTOKEN
from page to page via URL .
MattRobertson - 29 Sep 2004 00:28 GMT
the values CFID and CFTOKEN are stored in a cookie, as OldCFer pointed out.

Check out CF's URLSessionFormat() function to see a way for CF to auto-sense
whether cookies are enabled or not, and deal with the situation accordingly.

--Matt--
MSB Designs, Inc.... http://mysecretbase.com
Three people can keep a secret if two of them are dead.
- Benjamin Franklin
topshark - 29 Sep 2004 03:12 GMT
>>>Check out CF's URLSessionFormat() function to see a way for CF to auto-sense
whether cookies are enabled or not, and deal with the situation accordingly.<<<

I am not familiar with that function, and cannot find it in the WACK index or
in the list of CF functions.  Can you tell me if it's usage is explained
somewhere in the WACK, or perhaps I can find some information on it?

Thanks

Phil
MattRobertson - 29 Sep 2004 21:21 GMT
When all else fails RTFM :-)

http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/funca115.htm

--Matt--
MSB Designs, Inc.... http://mysecretbase.com
Moderation is for monks.
-Anonymous
topshark - 29 Sep 2004 21:41 GMT
Thanks for the link

I looked at that and Im not sure that would help in this situation.   Take a
look at this query which relies on two session variables  ---->

<cfquery name="caterers"  datasource="#datasource#"
cachedwithin="#createTimeSpan(0,0,10,0)#">
            select *
            from bg_companies a left outer join
            bg_advertisers b ON a.bg_company_ID=b.bg_company_ID
            where b.BusinessTypeID=#session.Businesstype.businesstype# and (b.regionID
= '#session.region.regionID#' or  b.regionID = '0')
            order by b.adlevel desc, a.company
            </cfquery>

I have similar queries throughout the site which rely on these two sessions.  
So far it has been working smoothly until  I got an email from someone saying
they got this error ---->

Element BUSINESSTYPE.BUSINESSTYPE is undefined in SESSION.

So far, I have not been able to duplicate that error, nor has anybody else.  
I suspected that  it may be a cookie issue, but now I have my doubts.

I would appreciate if anyone can test it and see if their browser returns an
error -----> www.banquetguide.com

thanks

Phil
MattRobertson - 29 Sep 2004 21:59 GMT
The site seemed to behave itself.

the function would help in the sense that you would code your application to a
format that always passes the key pair around .  urlsessionformat() allows this
info to be concealed if its not needed.  You don't just use it on anchor links.
Form posts as well., for example.  A cflocation would have to have
addtoken="yes", though.

One way or another, if cookies are turned off session management will not work
unless you pass the key pair from page to page.  It works for YOU because you
already have the cookie, since you've been to the site, so turning them off on
your computer won't do anything unless you account for this and delete the
cookie on your box, so you can simulate a truly new visitor.

--Matt--
MSB Designs, Inc.... http://mysecretbase.com
"Sculpture is what you bump into
 when you back up to look at a painting."
- Ed Reinhart
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.