vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Miscellaneous Hacks - CES Cookie Cutter - Share Cookies Between Domains (https://vborg.vbsupport.ru/showthread.php?t=139272)

thincom2000 02-12-2007 10:00 PM

CES Cookie Cutter - Share Cookies Between Domains
 
CES Cookie Cutter
vBulletin 3.6.x, 3.7.x, & 3.8.x supported
Version: 1.2.3

*** NEWS ***
4/12/2009 - v1.2.3 released
4/11/2009 - v1.2.2 released
8/8/2008 - v1.2.0 released
2/18/2008 - v1.1.5 released
2/11/2008 - v1.1.0 released
2/13/2007 - v1.0.0 released

Known Issues:
- none

What It Does:
Shares cookies among domains for seamless vBulletin login/logout functionality across multiple domains.

Basically if you have more than one domain name, or you have private forums scattered among domains, and all vBulletin instances use the same vBulletin database, this hack allows for integrated, synchronized login/logout on all domains at once.

Products to Install: 1
Plugins Included: 3
Files to Upload: 1
Templates to Edit: 0
Files to Edit: 0

Mod Features:
- Adds a field in vBulletin Options to enter multiple forum URLs
- Integrates login/logout functionality at all forum locations
- safety cookie settings available for users who left their cookie domain blank in vBulletin cookie options

Changelog:
Version 1.2.3:
- bug fix: only logouts integrate

Version 1.2.2:
- bug fix: XSS flaw
- bug fix: remember me

Version 1.2.0:
- updated: no more template edits
- updated: rearranged the whole mod
- bug fix: IE P3P failure

Version 1.1.5:
- new feature: cookie debug mode
- bug fix: global cookies only apply to www

Version 1.1.0:
- extended: now supports domains sharing the same file location
- bug fix: integrated login is not bidirectional
- bug fix: integrated login fails if forum is turned off
- bug fix: redundant cookies are generated

* This mod is offered for free here. Please donate if you like this mod *

BobbyBig 02-13-2007 12:17 PM

Very handy, nice work.
Btw you forgot to reserve first post :)

Eagle Creek 02-16-2007 01:19 AM

I LOOOOOOOOOOOOVE this hack!
T H A N K Y O U S O M U C H F O R T H I S!

thincom2000 03-17-2007 04:23 PM

I'm glad no one is having problems so far. You wouldn't believe how hard it was to make this work correctly all the time. Unfortunately, I have yet to try sharing between 3+ domains. Anyone have success there?

Realturktiger 03-17-2007 04:42 PM

i've tried the hack...
i've two domains on same forum but i can't login from the addon one....
my forum is on www.universte.com/vb
i can't login from www.turktigers.com/vb/

what's my problem ?

thincom2000 03-17-2007 04:50 PM

Did you upload ces_cookies.php into the includes/ directory on BOTH domains?
Did you make the template edit (sometimes this can be overlooked)?

* Did you add both domains to the setting CES Cookie Sharing Domains? You may have to include the /vb since I noticed your forum is not at the domain root.

mdcdeve 10-02-2007 12:05 AM

Hola, thanks for this, great work. Just wondering, can you set more than one cookiedomain in ces_cookies.php?

thincom2000 10-02-2007 11:30 PM

You need one ces_cookies.php for each domain in the appropriate folder. Then you can add the additional domains in the options.

wsdeluxe 10-05-2007 12:19 PM

I've got a problem...its settings the cookies for all domains, except the "master" forum domain.


I've got

www.domain1.com/forums/
www.domain2.com
www.domain3.com
www.domain4.com

2,3 and 4 have the correct cookies, but the domain 1 is not setting the cookies.

My forums are all on the same server, I modified the ces_cookies.php to connect to the correct directory:

Code:

chdir("/home/webmaste/public_html/forums/");

require_once('./global.php');
require_once('./includes/functions_login.php');
require_once('./includes/adminfunctions.php');

Thats on all the sites in the includes folder.

Any ideas at whats gone wrong here? The only way I can currently log into the actual forum is by logging in at /admincp/

Thanks

thincom2000 10-05-2007 02:23 PM

I think the /forums on the first domain may be messing it up. Cookies are generated at the root level.

Another issue you may be having is that browser standards usually only generate a maximum of 18 (I think) cookies at a time. I believe that each domain generates between 2 and 4 cookies, so 4 domains may be the most that will work without making many file edits.

wsdeluxe 10-06-2007 08:54 AM

Ahh, damn :(

Would some kind of iframe hack work, or not?

scoutz 11-05-2007 02:18 PM

I've been looking for something like this for a while... Anyone got this to work? Doesn't seem to work in IE 6 and IE7. Firefox works perfectly though :(

scoutz 11-05-2007 07:31 PM

nevermind fixed something myself, working now! :)

Mighty.Karen 11-07-2007 06:13 PM

Would this work with a vBulletin forum and just a generic non-forum type web-app??

thincom2000 11-08-2007 06:20 AM

If the logins are integrated it should work in theory. However, all logins would have to be handled by vBulletin to function as expected -- since the appropriate hooks would need to be called, and the STANDARD_REDIRECT template used.

Tom1234 11-23-2007 08:30 PM

Does this hack assume there are two separate instances of vBulletin or does it work for one vBulletin instance that is accessible at two different domain names - e.g. two domain names that have the same IP address?

Would this be a good way to change your domain name without requiring all your members to log in with a password at the new domain?

thincom2000 11-24-2007 12:33 AM

Quote:

Originally Posted by Tom1234 (Post 1388289)
Does this hack assume there are two separate instances of vBulletin or does it work for one vBulletin instance that is accessible at two different domain names - e.g. two domain names that have the same IP address?

Would this be a good way to change your domain name without requiring all your members to log in with a password at the new domain?

I'm not sure how to answer your first question since I haven't done extensive testing. I had two domain names that pointed to different subdirectories on the same server. While structurally it appeared to be two instances of vBulletin, the subdirectories were actually mirrors.

For this mod to work, I believe the only thing you need is one of two copies of ces_cookies.php in each respective subdirectory, and you may or may not need to redefine $vboptions['bburl'] in those files. You just have to try it and see if it works for your particular setup.

Alfa1 01-10-2008 04:00 PM

Will this work if I have the following setup:
-domain1.co.uk
-domain2.com
-domain3.com

-domain1.co.uk/testvb/

Domain 1-3 are the same installation of vbulletin, but one can browse the same site under all 3 urls.
The cookie domain currently set at domain1.co.uk, so that going from domain1.co.uk to domain1.co.uk/testvb/ will not cause cookie/login problems.

But it seems this setup will not work to accomplish cookie sharing. Please advise how to handle this.

Eagle Creek 02-06-2008 11:10 PM

Does this hack work with the most recent vBulletin?!
If it doesn't: what should I use?

thincom2000 02-07-2008 12:36 AM

I will be releasing the 3.7 version shortly, which I don't believe has any real changes other than a restructuring of the code (because I discovered the sharing was not accomplished while a board is disabled. This can be a hassle for admins who are trying to work with that situation.

Quote:

Originally Posted by Alfa1 (Post 1419020)
Domain 1-3 are the same installation of vbulletin, but one can browse the same site under all 3 urls.
The cookie domain currently set at domain1.co.uk, so that going from domain1.co.uk to domain1.co.uk/testvb/ will not cause cookie/login problems.

But it seems this setup will not work to accomplish cookie sharing. Please advise how to handle this.

I hope that what you describe is possible... As long as the cookie is saved at each domain root, it should be available from all subfolders (or do you want to avoid that?).

NeverBored 02-11-2008 05:18 AM

Quote:

Originally Posted by thincom2000 (Post 1437779)
I will be releasing the 3.7 version shortly

subscribing for a 3.7 release :up:

zlos 02-11-2008 07:33 AM

I have also one /var/www/public_html/forums catalogue, which is from DNS shared amont two domains. E.g. I can't put two instances of ces_cookies.php file, as there might be only one file in the same catalogue...

If 3.7 version solves this problem I would love to have it installed.

thincom2000 02-11-2008 02:40 PM

Quote:

Originally Posted by zlos (Post 1440632)
I have also one /var/www/public_html/forums catalogue, ... I can't put two instances of ces_cookies.php file, as there might be only one file in the same catalogue...

I have the same setup on my site as of about 2 months ago. Since, this issue has been solved for the 3.7 version.

valdet 02-11-2008 05:31 PM

I have two forums working on the same VPS but on different databases.

First forum is www.mysite1.com/forum and
Second forum is www.mysite2.com.

Before I try this (and eventually mess up with my cookies) I would like to know if it is possible to have users from both forums be able to login to both forums using this hack?
I have separate databases for these forums, but I could give access to each-other database users

I look forward to your reply.

Alfa1 02-11-2008 05:47 PM

Has ces_cookies.php changed since the 3.6.x version?

thincom2000 02-11-2008 06:40 PM

Quote:

Originally Posted by valdet (Post 1440910)
I have two forums working on the same VPS but on different databases... I would like to know if it is possible to have users from both forums be able to login to both forums using this hack?

The scope of this mod doesn't cover integrating logins between vBulletin installations. This only generates cookies for additional domains if say your vBulletin is accessible from .com and .net. The cookies, however, should only be effective on that database unless the two databases are identical and users have the same password / cookie salts on both.

If you really want to integrate both, I would recommend merging the databases, and modify forumhome to display particular forums on each domain. Then you can use the Cookie Cutter to log in to both.

Alfa1 02-11-2008 07:29 PM

When you have the same site, with multiple urls, then the cookie cutter works well, except for that members still have to log in one time for each domain. I have one site with 3 domains/urls:
mymaindomain.com
myblogdomain.com
mywikidomain.com

There is no difference between the above other than the url being different. However when I want to browse these 3 domains, then I have to log in at every domain. After I do that and tick 'remember me', I keep being logged in.

It would be optimal if I would only have to log in one time for all tree domains.

thincom2000 02-12-2008 02:19 AM

Quote:

Originally Posted by Alfa1 (Post 1440990)
It would be optimal if I would only have to log in one time for all tree domains.

This was the intended functionality all along, but I think it stopped working around 3.6.8. Since the 3.7 changes, the beta seems to work correctly again.

NeverBored 02-12-2008 02:46 AM

So this works for 3.7 as is?

thincom2000 02-12-2008 03:02 AM

Quote:

Originally Posted by NeverBored (Post 1441165)
So this works for 3.7 as is?

Just uploaded the new one. So now it does.

NeverBored 02-12-2008 05:26 AM

Just tried it out...

It doesn't seem to be working for me on 3.7.

To be sure I'm understanding correctly, I should be able to install this, log in to my forum on the .com domain, then go to my .net domain and still be logged into the forum browsing the forum on .net, right? When I go to .net I'm not logged in.

thincom2000 02-12-2008 08:19 AM

You did make the template edit and upload the file to both includes directories and add both domains to the new vB setting?

NeverBored 02-12-2008 05:54 PM

Yeah I did all that, though I guess one part I don't understand is "upload the file to both includes directories". Both domains access the same site. All the same files and database, just can be accessed with multiple domains.

thincom2000 02-12-2008 06:16 PM

Okay - what value have you entered into the setting?

NeverBored 02-12-2008 06:52 PM

First I used

neverboredonline.com
neverboredonline.net

When that didn't do anything I put in

neverboredonline.com/forum
neverboredonline.net/forum

That didn't do anything either. Each time I would clear the cookies, and do a fresh log in via .com. Then I would go to the site via .net and I'm not logged in.

thincom2000 02-12-2008 06:54 PM

Okay I think the issue is that your forum is located at /forum.
So you would have to use the /forum version.
Also make sure to start each entry with a .
I think you might be getting 404 errors without it.

NeverBored 02-12-2008 07:09 PM

Awesome man, thanks. It's working now. I wasn't even seeing the instructions to add the . at the start of the entries even though I read through it multiple times, lol. Thanks

NeverBored 02-12-2008 08:16 PM

Actually, I'm having some problems still.

First problem, it's not working in IE 7. (It's working in Firefox)

Second problem, when a user logs out it completely clears the who's online list.

thincom2000 02-13-2008 05:36 AM

Thanks for the report. I'll look into this.

thincom2000 02-18-2008 05:11 PM

Okay, I figured out why the Who's online list was getting cleared, but the fact that this isn't working in Internet Explorer has me stumped. It's as if Internet Explorer is reporting the originating domain to the script rather than the domain the script is actually running from... If anyone has any ideas please let me know, because I hate IE.


All times are GMT. The time now is 06:15 PM.

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.02638 seconds
  • Memory Usage 1,823KB
  • 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)bbcode_code_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete