Hi Kiran, thanks very much for that. This is what we’ve written so far…
function gd_snippet_190913_set_current_location( $location ) {
if ( ! empty( $location->type ) && geodir_is_page( "location" ) ) {
setcookie("last_location",base64_encode(serialize($location)));
}
return $location;
}
add_filter( "geodir_set_current_location", "gd_snippet_190913_set_current_location", 10, 1 );
How would we get the value that we’ve written into the cookie, into the user session? For example:
add_action( 'init', 'process_post' );
function process_post() {
if( isset($_COOKIE['last_location']) ) {
$_SESSION[‘YOUR_KEY_HERE’] = unserialize(base64_decode($_COOKIE[‘last_location’]));
}
}
What is the session key that we need please?
Thanks,
Dave