php - Cookies not visible after ajax/load request -


i have following problem:

on 1 page display articles using php , grabbing them database. articles have 2 display types: daily , hourly. display type stored in cookie.

the problem whenever load additional articles using infinite scroll , ajax cookies not taken. if echo them receive empty string. when changing hourly view daily view same problem occours.

for adding additional post use jquery post , loading diferent display view use jquery.load()

i know there cross origin policy fixed adding in htaccess

header add access-control-allow-origin "*" header add access-control-allow-headers "origin, x-requested-with, content-type" header add access-control-allow-methods "put, get, post, delete, options" 

edit: installed website on server works ok. noticed on server tha ajax request sending "settings" cookie. on bad server "phpsessid" cookie beeing sent.

ok seems problem www request made www.mydomain.com mydomain.com fixed adding full path in url

$.ajax({    url: "www.mydomain.com/ajax.php",    success: function() ... }); 

or

 site_url = "http://www.mydomain.com";  $('#wrapper').load(site_url 'index.php?lang='+langsite+' #wrapper', function(data){ ... 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -