N
N
N3K2011-02-10 13:02:45
PHP
N3K, 2011-02-10 13:02:45

Sub domain sessions via ajax requests?

So I started to analyze this topic, I found an interesting problem:
I set the parameters in .htacess

php_value session.cookie_domain .portal.my<br/>
&lt;IfModule mod_headers.c&gt;<br/>
Header set Access-Control-Allow-Origin &quot;*&quot;<br/>
&lt;/IfModule &gt;

In php, I specified the same parameters for all cookies
session_set_cookie_params(60*60*24*14,'/','.portal.my');

I checked - all cookies are normally set on .portal.my and are available from any subdomains. But the problem arose in Ajax requests: The "Header set Access-Control-Allow-Origin "*"" parameter allows making Ajax requests to subdomains, but it ignores the cookies that come from them, although the firebug shows that they come. Tell me how to deal with this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene, 2011-02-10
@Nc_Soft

And if through jsonp?

A
Alexander, 2011-02-11
@akalend

may help habrahabr.ru/blogs/personal/80220/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question