Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function(config) {
- var config_copy = JSON.parse(JSON.stringify(config));
- //post cookie
- $.ajax({
- url: "php/pivot_cookie.php",
- type: "POST",
- data: config_copy,
- success: function(){ alert("Cookie: success") },
- error: function(data){alert(data);}
- });
- }
- $cookie_name = "pivot_config";
- $cookie_value = $_POST['config_copy'];
- setcookie($cookie_name, $cookie_value, "/");
- //cookie check function
- if(!isset($_COOKIE[$cookie_name])) {
- echo "Cookie named '" . $cookie_name . "' is not set!";
- } else {
- echo "Cookie '" . $cookie_name . "' is set!<br>";
- echo "Value is: " . $_COOKIE[$cookie_name];
- }
- $(document).ready(function(){
- $.ajax({
- url: "php/pivot_cookie.php",
- type: "GET",
- data: (cookie - I dont know how to get it),
- success: function(){ alert("Cookie Retreival: success") },
- error: function(data){alert("Cookie Retrieval: failure");}
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement