vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   There has to be a simple way... (Multiple domains & subdomains) (https://vborg.vbsupport.ru/showthread.php?t=117438)

Arketh 06-02-2006 02:45 PM

There has to be a simple way... (Multiple domains & subdomains)
 
I've been beating my head against the wall. I know there should be a way to do it. But I can't seem to get a valid (and current) pointer on how to do it. I've tried searching, but that's failed me so far.

The problem:

Common occurance. I've got a .com/.net/.org and a 4th related domain. All run the same content, as they're just pointed together. All are setup with a subdomain to point to the forum.

What I want is to have vb set up a cookie for which ever domain a user logs in on, that can be used across that domains subdomains.

So if they log into forum.xyz.com, I can use the cookie for game.xyz.com or just xyz.com. And I can do the same for each domain. Basicly a .xyz.com cookie when you login via xyz.com, and a .xyz.net when you login via xyz.net.

Or, if there's no such mod, point me in the direction of the cookie code. It shouldn't be too hard to create at least an inelegant hack that'd set the cookie up for the current domain.

Arketh 06-04-2006 02:18 PM

Turns out, there's actually a very easy way to do it, just overload the cookie domain variable with the correct domain name. I did it by calling a custom function to strip the base domain name from $_SERVER[SERVER_NAME] and return just the domain name (ie: xyz.com from qrs.xyz.com) and then setting the cookie domain variable to "." . $domain.

I'm sure if I wanted to spend a bunch of time at it, I could make a nice elegant hack that ties into the AdminCP, but right now I've got other matters on my plate.


All times are GMT. The time now is 06:21 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01742 seconds
  • Memory Usage 1,703KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete