Handling Cookie values in Custom Script by Javascript
Content
Hi,
In the Contact workspace, We have added a tab to implement a feature where we are using custom script.
We want to pass some vales from one script to another by cookie.
Cookie setting is OK. We are getting the value from the cookie.
$_COOKIE["course_name"] = $student_course_details["course_name"];
echo "Cokievalue".$_COOKIE["course_name"];
But when we tried to access the value from javascript, it is giving me null.
Here is my javascript code:
<script>
var cokie_value = getCookie('CourseName');
alert(cokie_value);
function getCookie(name) {
var regexp = new RegExp("(?:^" + name + "|;\s*"+ name + ")=(.*?)(?:;|$)", "g");
var result = regexp.exec(document.cookie);
0