davychen Posted March 19, 2016 Share Posted March 19, 2016 hi, i need help... the question is, i have a web site, say "abc.com" i put it under server www root path, say "\abc\" there are some php scripts manipulating user account related issues, say under "\abc\userlibs\" now i have another second level domain, say "def.abc.com" it's under "\def\" here i need to call user account scripts, but can use something like "def.abc.com/../abc/userlibs/" parent path "../" seems not allowed, then how can i manage it? i use apache & php. thank you. davy Quote Link to comment Share on other sites More sharing options...
davychen Posted March 19, 2016 Author Share Posted March 19, 2016 i've solved it........... thanks for stackoverflow it's a typical cross domain problem, key is to let such 2 kind of domains share php session & cookie: 1) abc.com 2) def.abc.com solution is easy & simple: add 2 lines before session_start(): $some_name = session_name("some_name"); session_set_cookie_params(0, '/', '.abc.com'); session_start(); then everything is ok. thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.