WP_Session not acting with AJAX

I think in your code you must add this line for ajax acting

jQuery.ajax({
type    : 'POST',
url     : '<?php echo admin_url('admin-ajax.php'); ?>',
data    : { action : 'vg_show_post_id', post_id: $post_id, data-id: true },
),

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)