It’s Friday afternoon and my brain is fried.
I have a unique server side ID stored in a cookie.
For site stat purposes i need to have a unique event identifier of no more than 20 characters which is made up of the page name and the remaining number of charcaters from the session id.
So if the page name = selectPlan that is 10 characters.
Therefore i would need the last 10 characters from the session ID to complete the event identifier.
So far i have come up with:
var $JSESSIONID = $.cookies.get('JSESSIONID');
var $event22 = 'selectPlan';
var $remLength = 20 - $event22.length;
var $remSession = $JSESSIONID.substr(0,$remLength);
var $event22 = $event22 + $remSession;
alert($event22);
Am mostly confused about reading the JSESSIONID from the end rather then the start with substr.
isn’t taking the last $remLength characters from $JSESSIONID just going to be