last day (14 days later) » 

12:30 PM
0
A: Session do not work on ajaxRequest [How to count ajax-request with session variable]

Kevin LabécotAfter testing your pages, your problem is related to your domain. http://www.huntinggrounds.de/aa.html is working fine, not http://huntinggrounds.de/aa.html For security reasons, cookie is per-domain specific. Cookie set by PHP on http://huntinggrounds.de/aa.html will not work on http://www.hun...

 
you are right it seems to work. But on future use I'am calling the file from different pages. I will store how often the user did his ajax-call in a database. So that mean I cant do that serverside?
 
You can allow subdomains to share the session's cookie by updating the default PHP configuration. Try to put this at the top of your PHP page (before session_start) : ini_set('session.cookie_domain', '.huntinggrounds.de' );
 
done without any success
 
Try to put this directive directly into php.ini, maybe ini_set is not allowed to you.
Try this too : session_set_cookie_params(0, '/', '.huntinggrounds.de');
 
do not run my own server, so I have no access to php.ini. Can I check it somewere
 
12:30 PM
See my comment above, it may solve the problem too.
 
session_set_cookie_params(0, '/', '.huntinggrounds.de');: CHECKED do not work
 
hi
Are your changes online ?
 
hi there to; changes are online
 
made a php-info file on www.huntinggrounds.de/info.php
 
12:38 PM
ok
In aa.php can you add header("Access-Control-Allow-Credentials: true") please ? at the top, before the other header line.
Tell me when it's online.
 
done.
the first two line are:
header("Access-Control-Allow-Credentials: true")
session_set_cookie_params(0, '/', '.huntinggrounds.de');
 
ok
you did a mistake, there is an error :)
 
do you see the error?
 
Missing ; after the header line
 
I just copied your lines. ; missing
its ok now
semms not to help
 
12:43 PM
Did you removed Access-Control-Allow-Origin ?
 
no
here is the header stuff:
header("Access-Control-Allow-Credentials: true");
session_set_cookie_params(0, '/', '.huntinggrounds.de');
session_start();
header('Access-Control-Allow-Origin: *');
 
ok
argh
2s pls
Can you try to change header('Access-Control-Allow-Origin: *'); to header('Access-Control-Allow-Origin: http://huntinggrounds.de, http://www.huntinggrounds.de');
 
done
you will get an error
 
yep. Sorry, We need to devide it in two lines. So :
`header('Access-Control-Allow-Origin: huntinggrounds.de');`

`header('Access-Control-Allow-Origin: huntinggrounds.de');`
 
done
same thing
 
12:53 PM
I modified the lines. Can you show me what is currently online ?
Well, I think I found something better. Wait a little please.
 
header("Access-Control-Allow-Credentials: true");
session_set_cookie_params(0, '/', '.huntinggrounds.de');
session_start();
header('Access-Control-Allow-Origin: http://huntinggrounds.de');
header('Access-Control-Allow-Origin: http://www.huntinggrounds.de');


if (!isset($_SESSION['zaehler'])) {
$_SESSION['zaehler'] = 1;
} else {
$_SESSION['zaehler']++;
}
echo $_SESSION['zaehler'];
 
there are two different huntingground.de one with www. one without. the editor here eat it
 
ok
I don't have enough time but the success is near. I hope I helped your a little. Maybe you can read stackoverflow.com/questions/19519028/…
I think it will help you a little more
I have to go...
I'm sorry to leave before the problem is solved
 
thx for your help anyway
 
12:59 PM
good luck :)
 

last day (14 days later) »