Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ColdFusion Client vs Session Variables

Tags:

coldfusion

I have a largish application that runs fine and uses session variables widely

We wish to push it into the cloud and run multiple instances. Unfortunately our cloud partner doesn't offer SSL stick sessions and even if they did, im not sure that would be the way to go.

What I would rather do is not rely on a user maintaining a session on a server and I can achieve this using Client variables.

I'm wondering however if there are any downside, is it overly slow are there certain variable types that dont work with Client variables structs / queries etc?

There are over 1500 lines of code using session variables, and I could just do a search and replace or I do I need to go through hundreds of components and rethink each one.

like image 622
Dale Fraser Avatar asked Jan 12 '12 05:01

Dale Fraser


2 Answers

Yes, client variables are limited in what they can store.

From the docs: Client variables must be simple data types: strings, numbers, lists, Booleans, or date and time values. They cannot be arrays, recordsets, XML objects, query objects, or other objects.

like image 62
Yisroel Avatar answered Oct 03 '22 22:10

Yisroel


Client variables limited to simple variables like strings, numbers etc. But I do use client variable to store structure and array by serializing to JSON. In many sites I have used to client variable to remember form field values (specially search criteria) so when user come back we can get them their last status.

What I just need to do that while storing into client serialize it and to get it back deserialize.

Hope this help

like image 20
Pritesh Patel Avatar answered Oct 03 '22 20:10

Pritesh Patel