hi, every one....!!
i have two sites i.e
mydomain.com
secondsite.mydomain.com

i want to make single login or signup account for both....!! how can it is possible.......!!

My problem is that if i pass single session to one site it working but when i open my other site it doesn't works..........!! Please help

Member Avatar for diafol

Are the sites identical. If so, just point one of them to the other via A RECORD. Otherwise, you've got more work to do! Sessions to my knowledge, can't exist across domains. The only thing I can think of is if your sessions are stored in a DB. However, you need a way of accessing both DBs from the one website - I think you need to fiddle with "sockets" (I may be wrong).

Your domains suggest that one of your sites is a subdomain of the main domain. If so, you may be able to have a shared DB, which would solve the problem.

DB handling of sessions is less straightforward than simple use of $_SESSION variables, but tend to be more secure. There should be a number of free scripts out there to get you started.

I'm sure some pros/ more seasoned programmers could give you better advice than this though.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.