Get current URL inside ajax callback? I have created custom module called mymodule.

In this URL localhost/mymodule/name, I have this field:

$form['name'] = array(
  '#title' =&gt; t('Enter name'),
  ...
  '#ajax' =&gt; array(
    'event' =&gt; 'blur',
    'callback' =&gt; 'mymodule_ajax_callback',
    'wrapper' =&gt; 'my-wrapper',
    'method' =&gt; 'replace',
  ),
  ...
);


My ajax callback is successfully called:

function mymodule_ajax_callback($form, &amp;$form_state) {
  ...
  return ...
}


However, inside 'mymodule_ajax_callback', I need to get the current URL of the page which is localhost/mymodule/name. Currently it returns system/ajax which is how Drupal works by nature.

How to get the current URL inside the ajax callback?
As said by @Jayendra Kainthola 
You need to store current path value in a session

$_SESSION['current_path'] = current_path();


Then use it inside your callback function as follows : 

function mymodule_ajax_callback($form, &amp;$form_state) {

$current_path = $_SESSION['current_path']  ;//gives the current path

}