Hi John,
Im trying to set the cookie but it does not seems to work. I would like to see if Im missing something. I will post what I did.
1. I added a javascript file to the [js] folder and I added its definition to default.aspx . This file contains code to set cookies , see bottom Set_Cookie function.
2. I added an IMG tag as the following: <IMG onclick=" Set_Cookie('SkinSrc0','[L]Skins/DarkBlue/DarkBlue.ascx',300000,'/')">
When I click the image, the cookie is created in the temporary Internet Files folder, so the javascript code is working, however I dont know if Im missing a parameter or something because I double checked Im on Portal0, and I verified the Skin Exists but still the skins does not change when I reload pages.
Many thanks in advance
function Set_Cookie( name, value, expires, path, domain, secure )
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );
/*
if the expires variable is set, make the correct
expires time, the current script below will set
it for x number of days, to make it for hours,
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );
document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}