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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

session variables with mobile

Status
Not open for further replies.

lucidtech

IS-IT--Management
Jan 17, 2005
267
US
I'm building my first mobile site (like the dumbed down facebook mobile version). Thing is, session variables only last for a page. After that they seem to be reset. How do I set the Application to store session variables for the site so that a mobile will remember them for longer than a refresh? Here's the beginnings of my Application.cfm file.

<cfapplication name="mySiteMobile" clientmanagement="Yes"
sessionmanagement="Yes"
sessiontimeout="#CreateTimeSpan(0,8,0,0)#"
applicationtimeout="#CreateTimeSpan(0,24,0,0)#">
 
are you using CF5?
If not you should be using application.cfc
do you have nested folders with other application.cfm files? make sure session management is set to yes in them as well.
if you're using client variables, make sure cf has valid client management configured in the administrator.

Vegans are friends, not food...
 
I'm using CF8. Main folder has the application.cfm listed below (I'm only posting the first part). The App file I posted at the thread start is in the sub-folder "mobile". I want to use session management, and have done this via posting CFIDE and CFTOKEN tags to every page, but i'd rather not do it this way. Right now my main issue is I cannot get the mobile browser to store a single cookie... everytime I close the browser all cookies are removed even though I have them set to never expire. Facebook stores cookies on my phone, but my site won't.... I'm dumbfounded.

<cfapplication name="myMainSite" clientmanagement="Yes"
sessionmanagement="Yes"
sessiontimeout="#CreateTimeSpan(0,8,0,0)#"
applicationtimeout="#CreateTimeSpan(0,24,0,0)#" setdomaincookies="true" Clientstorage="Cookie">
 


<cfapplication name="mySiteMobile" clientmanagement="Yes"
<cfapplication name="myMainSite" clientmanagement="Yes"

sessions persist across a single application, with a single name.


Vegans are friends, not food...
 
I don't need to carry the session across the two folders though.
 
what happens if you go to on your mobile phone?

I used your cfapplication tag and tested on my iPad with safari, atomic web browser, and terra. Also tested on my Droid X with the default browser. All work fine.

Vegans are friends, not food...
 
On my computer's browser, works fine. On my mobile browser, which is old school, nothing like safari and the like, I step1.cfm works, but then I get a "500 Internal Server Error", which I'm guessing is for the same reason I get them on my site, the cookie doesn't exist. But I know my phone's browser can store cookies because facebook's mobile site does.
 
I'm not sure how facebook's mobile site works and have no interest in finding out. For all I know it's passing the session token in the url.

Vegans are friends, not food...
 
i considered the idea that they might be posting a user id token or session token to every page so when you bookmark its stored, but i can't imagine they're that dumb. I'm going to try storing cookies with php soon, just to satisfy my curiosity.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top