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!

Client Variable (Urgent !!)

Status
Not open for further replies.

micheals

MIS
Dec 14, 2003
11
MY
I am storing some data in client variable using registry.
The data is only be destroyed when the user click logout.

<cfset IsDeleteSuccussful=DeleteClientVariable(&quot;memberid&quot;)>

However if the user close the browser without logout, the data will maintain in the registry. Is there any way where i can set the expired time or time out for this client variable ?

Thanks in advance.
 
Micheals,

Why are you storing the info in a client variable? and why are you using the registry? The disadvantage of client variables is that they relate to the PC on which the browser is running, not to the user. So:
* if the same user logs in on a different PC, the client variable is not available.
* if another user access your site from the original PC, the client variable is active.
If you want the info to exist only for the duration of a session, why don't you use a Session variable?
 
Watch out. If you're clustering servers, sessioned could get nuked. This is a good reason to use client variables, because this info is stores in special CF tables in your Database.

FYI
 
The reason why i use client variable is that :
I want to store a unique 'CFToken' in my shopping cart table in the Database.
I will consider using session if the session variables have something like CFToken (or maybe called SessionID) which are unique to identify user and can be stored in the database. (pls let me know if there is a unique session identifier which i can save to DB)


>* if the same user logs in on a different PC, the client variable is not available.
Since I have a memberid store in the database, this would not be a problem for retrieving the shopping cart items. ( as long as the user login as member.)

>* if another user access your site from the original PC, the client variable is active.
This is the problem I am trying to look for a solution. I have tried to set expire date of the registry to 0.1 days in the administrator page. But it doesn't seem like to work. I think the minimum timeout can be set is 1 Day.
And also, unlike cookie, the client variable will remain in the registry even the user close the browser.


 
&quot;>* if another user access your site from the original PC, the client variable is active.
This is the problem I am trying to look for a solution. &quot;

can't you find a way to compare the memberid you get from the db when the user logs in and the client variable ?? this can be a solution
maybe you can store the member id as a client variable, and then compare the value you read from the db to that value, and if they're somehow different, you *know* it's another user and can delete the client variable

or you could look for the existence of any client variable and delete them all, and recreate them all, as the user logs in
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top