getValOnce SiteCatalyst Plug-in

Gets a value once per session or number of days.

Plugin Prototype
s.getValOnce(v,c,e)

Parameter Descriptions
v = Value to write in cookie or return
c = Cookie Name ‐ something like ‘s_evar1’ if you are populating s.eVar1
e = Number of days to expiration ‐ 0 for session

Example
Here is an example use of the plugin to take the value of s.prop1 and place that value
only 1 time into s.eVar1.

s.eVar1=s.getValOnce(s.prop1,'s_evar1',0);

Code

/*
 * Plugin: getValOnce 0.2
 */
s.getValOnce=new Function("v","c","e",""
+"var s=this,k=s.c_r(c),a=new Date;e=e?e:0;if(v){a.setTime(a.getTime("
+")+e*86400000);s.c_w(c,v,e?a:0);}return v==k?'':v");