Session variables not clearing
Hello,
I'm working on a series of web pages that will be compatible with an Apple iPad. Here's what I'm working on:
When a user hits my index.cfm page, CF checks a table for records. If there are no records, cflocation sends the user to a menu page and only creates one session variable, "Device."
If there is one record in the table, cf creates the variables "Device" and "Loc" and sets "Loc" to whatever the value in a certain table field is. Then cflocation sends the user to the same menu page as above, but because "Loc" is defined, the value of "Loc" is output in various places on the page.
If more than one record is found, the user must select their choice from the index.cfm page. From there, cflocation takes their choice, adds it to a url variable, and takes the user to a page that defines "Loc" based on the url variable. Then cflocation sends the user to the same menu page, but because "Loc" is defined, the value of "Loc" is output in various places on the page.
Everything works well.
Here's the problem: I can't get "Loc" to clear on demand. At the top of my index page, I have <cfscript>StructDelete(Session, "Loc");</cfscript> to clear anything that might be in the application. On my desktop (a PC browsing with Chrome), this works. For testing, I'll put one record in the table and the process that I described above works. If I delete that record and run index.cfm again, "Loc" is cleared and the menu page appears as it should.
However, if I add a record, run index.cfm on my iPad to create "Loc," then go back and delete the record from the table and run index.cfm again, the variable is still defined. This happens on the iPad only.
I'm stuck. Can anyone offer any insight?
Thank you!
