I’m moving a client site to jodohost. The backend uses sessions to track logins etc. and works fine with cookie-stored sessions on the existing host’s shared CF servers.
When I test the new site on jodohost’s servers, however, my sessions do not persist – they die without a trace unless I set my to addtoken and wrap my a href locations with urlencodedformat().
There’s got to be something fundamentally wrong that I’m just not picking up on here, but I’ve tried every variation on session and client storage that I can think of with no luck.
A real quick demo of the problem can be found here: http://204.10.107.95/admin/test.cfm . Sets a session variable, proves it’s been set – but if you then click a link to some other page on the same site, the session variable has vanished.
[QUOTE=thingwarbler]
I’m moving a client site to jodohost. The backend uses sessions to track logins etc. and works fine with cookie-stored sessions on the existing host’s shared CF servers.
thx – i thought that was what it was doing by associating the session with a cftoken that’s stored as a system-only cookie?
Are you suggesting bypassing session scope alltogether and simply setting a cookie that holds the necessary info? Doesn’t that create problems when visitors close their browser w/o properly ending the session and allowing the system to delete the cookie as required?
[QUOTE=thingwarbler]
A real quick demo of the problem can be found here: http://204.10.107.95/admin/test.cfm . Sets a session variable, proves it’s been set – but if you then click a link to some other page on the same site, the session variable has vanished.
Anyone tell me what I’m missing here?
[/QUOTE]
Would you mind posting to code for those two test pages? Also, which CF server is your app running on?
You also mentioned that this code runs fine on your other host, what version of CF are they running there?
Dump session.test. The variable is currently: #session.test#
Okay, now go here, a simple a href link within the same site, same folder etc., and see if the session survives?
And here’s test2.cfm
Same application, same domain
-- but now what happened to session.test that we just set a single link ago?
#session.test#
The error I get is: Element TEST is undefined in SESSION, but on test.cfm (the first page, where session.test is first set) the variable is parsed out just fine, so it exists right up until the new page is loaded.
one last follow-up: client variables persist across pages with the setup I’m testing. That makes sense, since client vars are explicitly forced into cookies as specified in the cfapplication tag, but shouldn’t those same cookies be used by CF to maintain sessions?
The site currently sits on a CF5 Windows server. I’m trying to move this to wincf.jodoshared.com.
sorry, should have made that clear: there’s an underlying application.cfm that’ll run for both these pages – I only included the cfapplication in test.cfm for clarity.
Heh, I actually did it the other way around – intially there was no cflock (that didn’t work) – then I thought I’d give it a try with the lock in place (still didn’t work). But thx for suggesting it.
For now I’m probably going to rebuild the whole thing with either straight client variables cookies or addtoken and urlencodedformat. Bummer.