Hello everyone!
This board is a great resource!
I've looked at all the posts about cookies I could find...too many haha and I was wondering if you all could help me.
I want to store the user's post count on log-in to the cookie file.
Then I want to be able to read that post count from the cookie using javascript.
I have this for reading the cookie:
<script language="Javascript1.1" type="text/javascript">
<!--
var session_cookie = getCookie('sessionBOARDSESSIONNUMBERREMOVED');
if (session_cookie == null) {
var session_dt = "0";
var session_j = "0";
} else {
var session_array = session_cookie.split("&");
var session_dt = session_array[0];
var session_j = session_array[1];
}
function getCookie(name) {
var cname = name + "=";
var dc = document.cookie;
if (dc.length > 0) {
begin = dc.indexOf(cname);
if (begin != -1) {
begin += cname.length;
end = dc.indexOf(";", begin);
if (end == -1) {
end = dc.length;
} // end if
return (dc.substring(begin, end));
} // end if
} // end if
return null;
}
//-->
</script>
and I've also looked through the ultimatebb.cgi where it stores cookies, but I keep doing something wrong.
Any help is appreciated. I am running version 6.7.
Thank you!
