session problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

session problem

Post by itsmani1 »

I 3 sub domains, I log on to one domain and want to retain that login for all three sub domains.

Example:

If I logged on to beta.cmela.com session is working fine there but I want to retain that session for classifieds.cmela.com and community.cmela.com as well.

what should i need to do for it?

I also did:

Code: Select all

ini_set('session.cookie_domain', '.cmela.com');
thank you
dizyn
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Re: session problem

Post by itsmani1 »

In my settings:

and my session.save_handler value is: "files"
session.save_path: "no path" -> can i set a value for it? do i need to set a value for it?

session.cookie_path value is: /
will this save data in current directory in which i am?
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: session problem

Post by Zoxive »

Is

Code: Select all

ini_set('session.cookie_domain', '.cmela.com');
being called before session_start() ? And if so, is session.autostart off?

I usually put this in my php.ini, or .htaccess instead of setting it with ini_set.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: session problem

Post by Christopher »

Are the three domains on the same server? Do they share the same session files?
(#10850)
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

Re: session problem

Post by itsmani1 »

Yes they are on one server, there are three sub domains and i want to share the session between these three domains, once i set session for one it should work for other two domains as well.

Here are my session settings:
session.save_handler = files
session.save_path = no path
session.cookie_path = /

thank you
dizyn
Post Reply