Jump to content

a php sub domain question


davychen
 Share

Recommended Posts

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.  :lol:

davy

Link to comment
Share on other sites

:D 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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...