1

I have m.xxxx.com and www.xxxx.com subdomains all my project in the www.xxx.com and when I need to send ajax request like login and so on it return value but when I call it again the session and cookie removed

I was testing the application www.xxxx.com/mobile

and all the request where worked probebly what should I do

and also sitting Access-Control-Allow-Origin:*;

for the cross origin problem but the session not sharing between those two subdomains

Omar
  • 32,302
  • 9
  • 69
  • 112
Taymoor Q.
  • 1,371
  • 21
  • 33

1 Answers1

1

Try this:

The only way I can think of to do this would be to save the session data to a cookie, then open the cookie when the other domain is accessed. You can read how to do this here:

http://www.depiction.net/tutorials/php/cookies-session-variables.php

why do you want to do this?

or

Also you can try

You are looking for this function: session_set_cookie_params(). Say you have two domains:

site1.example.com
site2.example.com

In order to share your session data across both domains, call the following function before session_start():

session_set_cookie_params(0, '/', '.example.com');
Anand Solanki
  • 3,419
  • 4
  • 16
  • 27
  • for the mobile version so I don't want to change all over the code and make the same existing functionality – Taymoor Q. Mar 24 '14 at 13:05