1
EyeKeeper
Cookies in xoops 2.013.2 and multi-sites
  • 2006/8/16 19:52

  • EyeKeeper

  • Quite a regular

  • Posts: 209

  • Since: 2002/6/11


Hello All...

I set up the multi-sites hack (not the module) and edited the files manually.

So far so good...

I got the subsites running acording to the following situatio:

mainsite.com.br
sub1.mainsite.com.br
sub2.mainsite.com.br
sub3.mainsite.com.br

all the tables related to users are shared and login works fine.
My doubt is about the cookie... I'd like to use the same cookie for all sites and when I login in one of them and try to enter another one from the main or subsites I can enter the site already logged in...

I renamed all the cookies at the preferences to be the same...
what else am I missing?

thanks for any help

2
Dave_L
Re: Cookies in xoops 2.013.2 and multi-sites
  • 2006/8/16 19:59

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


To use the same cookies for all those sites, the cookie domain would need to be ".mainsite.com.br" (I think). Is that the case, or is the full domain name being used for the subdomains?

3
EyeKeeper
Re: Cookies in xoops 2.013.2 and multi-sites
  • 2006/8/16 20:37

  • EyeKeeper

  • Quite a regular

  • Posts: 209

  • Since: 2002/6/11


As far as I'm concerned it should be .mainsite.com.br (cookie)...
because I saw the cookie has the right value in the subsites but different ids

4
EyeKeeper
Re: Cookies in xoops 2.013.2 and multi-sites
  • 2006/8/16 22:52

  • EyeKeeper

  • Quite a regular

  • Posts: 209

  • Since: 2002/6/11


I was thinking a little bit further...

where is the path defined for the cookies?

I guess there might something refering to XOOPS_URL and if I could change this to the site's real path it could solve it all

5
Dave_L
Re: Cookies in xoops 2.013.2 and multi-sites
  • 2006/8/17 11:49

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


XOOPS doesn't have a standard mechanism for setting cookies. You would probably need to search for "setcookie" to locate all the calls, and add the domain parameter.

6
alfred
Re: Cookies in xoops 2.013.2 and multi-sites
  • 2006/8/17 12:45

  • alfred

  • Quite a regular

  • Posts: 249

  • Since: 2005/10/29


edit the /include/common.php :

make befor :
session_start();

this:

ini_set("session.cookie_domain","mainsite.com.br");

also:

...
session_set_save_handler(array(&$sess_handler, 'open'), array(&$sess_handler, 'close'), array(&$sess_handler, 'read'), array(&$sess_handler, 'write'), array(&$sess_handler, 'destroy'), array(&$sess_handler, 'gc'));
ini_set("session.cookie_domain","mainsite.com.br");
session_start();
...

Alfred

7
EyeKeeper
Re: Cookies in xoops 2.013.2 and multi-sites
  • 2006/8/17 17:40

  • EyeKeeper

  • Quite a regular

  • Posts: 209

  • Since: 2002/6/11


thanks!

it worked Alfred

8
krewl
Re: Cookies in xoops 2.013.2 and multi-sites
  • 2006/10/17 12:57

  • krewl

  • Just popping in

  • Posts: 39

  • Since: 2006/3/14


Where'd you get the multi-sites hack? Couldn't find it here..
-------------------
www.illinoisbmx.com

9
EyeKeeper
Re: Cookies in xoops 2.013.2 and multi-sites
  • 2006/10/17 16:34

  • EyeKeeper

  • Quite a regular

  • Posts: 209

  • Since: 2002/6/11


there is an easy-to-install version at www.code-plus.org, in the downloads section

Login

Who's Online

200 user(s) are online (124 user(s) are browsing Support Forums)


Members: 0


Guests: 200


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits