MSDN Library

expires Property

This topic documents a feature of Binary Behaviors, which are obsolete as of Internet Explorer 10.

Sets or retrieves the expiration date of data persisted with the userData behavior.


Scripting [ sUTCString = ] userData.expires

Possible Values

sUTCString String that specifies or receives the expiration date in Coordinated Universal Time (UTC) format.

The property is read/write. The property has no default value.


The expires property designates the amount of time that persisted information is available. T he persisted information is removed when the date is checked and the designated time has expired.


This example uses the expires property to set the expiration date of persisted data to one minute after the information is persisted.

.userData { behavior: url(#default#userdata)}

function fnSave(){
   var oTimeNow = new Date(); // Start Time
   oTimeNow.setMinutes(oTimeNow.getMinutes() + 1);
   var sExpirationDate = oTimeNow.toUTCString();

   oPersistDiv.expires = sExpirationDate;
   // Save the persistence data as "sTimeout"."sTimeout");


<DIV CLASS = "userData" ID=oPersistDiv onsave = "fnSave()" >
<INPUT TYPE=text ID=oPersistText>

Applies To


See Also

Introduction to Persistence

Community Additions

© 2016 Microsoft