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

Session variables

Status
Not open for further replies.

Silvy74

Programmer
Jun 18, 2002
4
IT
What is the substantial difference between the
session variables and the cookie variables
(except that the first are memorized in the server
and the second in the client machine)??

Is better use sessione variables or cookies variables?
 
Like you mentioned, session variables are stored in the server ram, so if the server gets rebooted or the cf service restarted, they are lost. If your server does not have a lot of RAM, and you get a lot of use, then you may see some problems there.

If you have a lot of traffic to your site, session variables do not scale too well if you need to use multiple servers. For a lot, this is not an issue. Clien variables work a lot better in this case.

Session variables can be controlled better -- they have a specific time out period and you can put complex variables (e.g Arrays and structures) into session scope that you cannot do with client vars. However, you need to use cflock to read and write to session variables.

They each have their use and one is better suited than the other depending on the circumstances. I hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top