1
CoolPops
Session cookie needs to be set for .host.name
  • 2004/12/21 19:43

  • CoolPops

  • Just popping in

  • Posts: 65

  • Since: 2003/4/9 1


How can I cause XOOPS to set the cookie for the session to be .myhost.org instead of myhost.org?

I use mod_rewrite for a few modules and virtual hosts, for instance: forums.myhost.org is really myhost.org/modules/newbb/ but when the user logs in from myhost.org and the cookie is set from myhost.org then when accessing forums.myhost.org the session cookie is not sent because the domain names do not match.

By specifying .myhost.org, this will cause the browser to send the cookie to anything.myhost.org ... forums.myhost.org, myhost.org, whatever.myhost.org...

Can this be done?

CoolPops

Edit: I realized I posted this in the wrong forum. If a moderator sees this and would like to move it to, say, XOOPS general usage questions or a more appropriate forum I would appriciate that.

2
ackbarr
Re: Session cookie needs to be set for .host.name

it can at the php level (probably in mainfile.php).

ini_set('session.cookie_domain''.myhost.org');

or in an .htaccess file (apache only)
php_value session.cookie_domain ".myhost.org"

3
CoolPops
Re: Session cookie needs to be set for .host.name
  • 2004/12/21 20:08

  • CoolPops

  • Just popping in

  • Posts: 65

  • Since: 2003/4/9 1


Ackbarr, thanks! That indeed made things work beautifully.

CoolPops

4
CoolPops
Re: Session cookie needs to be set for .host.name
  • 2004/12/21 21:31

  • CoolPops

  • Just popping in

  • Posts: 65

  • Since: 2003/4/9 1


Just to clear up any confusion, I used myhost.org as an example, it's not my site, nor am I affiliated with it in any way. I guess for examples I am going to start using localhost ... that's what I should have used to begin with, sorry.

I am using XOOPS to replacehttp://lifewithchrist.org not a site I do not have anything to do with, myhost.org.

CoolPops

5
ackbarr
Re: Session cookie needs to be set for .host.name

thanks for clearing that up, though I understood that you were only using it as an example

Login

Who's Online

174 user(s) are online (119 user(s) are browsing Support Forums)


Members: 0


Guests: 174


more...

Donat-O-Meter

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

Latest GitHub Commits