Home Revolution Fullwidth Forums Digitalsignagepress Problems and Help Device is already in use after browser restart Reply To: Device is already in use after browser restart

#49974
Martin Tighe
Member

Hi Ron,
I never got a reply to this from the developers so I fixed this myself,
This fix works (I’ve tested this) for DSP Lite and the enterprise edition (I suspect it will also work for other versions)

This problem occurs because of the cookie being set on this machine is set to expire in 20 years in seconds which now causes a 32 bit integer field to overflow to a negative number making it expire straight away/on browser restart.

To fix this we need to edit the ds_build_page.php for enterprise version or dsplite_build_page.php for dsplite (Please Make Sure you back this file up before making any changes)

Essentially any where a cookie is being set ( setrawcookie() ) set the third parameter to the following number 2147483647
What I had to edit where the following lines;

2 instances of…
FROM: $resCook = setrawcookie( $v_username, $v_value, time()+(20 * YEAR_IN_SECONDS), ‘/’, ”);
TO: $resCook = setrawcookie( $v_username, $v_value, 2147483647, ‘/’, ”);

2 instances of…
FROM: $resCook = setrawcookie( $v_username, $v_value, time()+(20 * YEAR_IN_SECONDS), COOKIEPATH, COOKIE_DOMAIN );
TO: $resCook = setrawcookie( $v_username, $v_value, 2147483647, COOKIEPATH, COOKIE_DOMAIN );

1 instance of…
FROM: $resCook = setrawcookie( $v_username, $v_value, time()+(20 * 365 * 24 * 60 * 60), ‘/’, ”);
TO: $resCook = setrawcookie( $v_username, $v_value, 2147483647, ‘/’, ”);

1 instance of…
FROM: $resCook = setrawcookie( $v_username, $v_value, time()+(20 * 365 * 24 * 60 * 60), $cookiepath, COOKIE_DOMAIN );
TO: $resCook = setrawcookie( $v_username, $v_value, 2147483647, $cookiepath, COOKIE_DOMAIN );

Once doing this restart the WordPress Server or services and refresh the caches on the machines being used for signage.

Hopefully this helps and “fixes” the issue for you, I’m not aware of any official fix from the developers (Which is a shame as it is a good product)

All the best,
Liam Thomas
Infrastructure Engineer