You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 64 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Using the nuke cookie for a subdomain [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
griffinsbridge
Captain
Captain


Joined: Aug 25, 2005
Posts: 380


PostPosted: Mon Apr 16, 2007 10:51 am Reply with quoteBack to top

Hello, long time no post. Sorry about that, work work and more work!!

I have a ravenNuke 7.6 site and Ive recently built a bespoke site for a subdomain.
I need the nuke cookie to be set so that the subdomain can recognise it.

Ive got so far. i have altered the code in Your_Account/index.php - function docookie() to this:
Code:
function docookie($setuid, $setusername, $setpass, $setstorynum, $setumode, $setuorder, $setthold, $setnoscore, $setublockon, $settheme, $setcommentmax){
$info = base64_encode("$setuid:$setusername:$setpass:$setstorynum:$setumode:$setuorder:$setthold:$setnoscore:$setublockon:$settheme:$setcommentmax");
setcookie("user","$info",time()+2592000,"","mydomain.com");
}

That sets the cookie to mydomain.com instead of www.mydomain.com, allowing my subdomain to read it.
The cookie works fine right across my main nuke site, in the forums and on the subdomain.
BUT, there is a twist!! (isnt there always)
Now, you can't log out of the nuke site anymore.

I am assuming I need to make some changes to function logout();

But Im buggered if I can find any changes to make.

Anyone got any bright ideas?

*edit*
Ive just found this thread on subdomains: http://www.nukecops.com/postt40947.html

But i think it's overkill for my needs.

_________________
Black listed: Beretta, Danny stewardson
1 owes $40 and the other £4500
Find all posts by griffinsbridgeView user's profileSend private messageVisit poster's website
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12397


PostPosted: Mon Apr 16, 2007 3:26 pm Reply with quoteBack to top

In the logout function, there's this line
Code:

setcookie("user", false);

TO

setcookie("user", false, "mydomain.com");

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
griffinsbridge
Captain
Captain


Joined: Aug 25, 2005
Posts: 380


PostPosted: Tue Apr 17, 2007 1:35 am Reply with quoteBack to top

Hi Evaders, thanks for that.

Unfortunately, it didn't seem to work. i still stay logged in when I tried to logout.

So I went on a googly search to brush up on how cookies work and how to delete them.
I found out that to "delete" a cookie, all you had to do is overwrite it with empty values, which I think, is what your code was trying to do.
So i came up with this:

My setcookie() in login is this:
Code:

$info = base64_encode("$setuid:$setusername:$setpass:$setstorynum:$setumode:$setuorder:$setthold:$setnoscore:$setublockon:$settheme:$setcommentmax");
setcookie("user","$info",time()+2592000,"","mydomain.com");

so I did my setcookie() on logout like this:
Code:

$info = "";
setcookie("user","$info",time()+2592000,"","mydomain.com");

Seems to work fine. I'm not sure if having the expiration time in an empty cookie will have any knock on effects, only time will tell.

Thanks for your help evaders, couldn't have done it without your suggesstion. Cool

_________________
Black listed: Beretta, Danny stewardson
1 owes $40 and the other £4500
Find all posts by griffinsbridgeView user's profileSend private messageVisit poster's website
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12397


PostPosted: Tue Apr 17, 2007 7:37 pm Reply with quoteBack to top

I guess false isn't the same as empty string in this case. Weird, but good to know

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
Sileencer
Nuke Soldier
Nuke Soldier


Joined: Nov 03, 2007
Posts: 10


PostPosted: Tue Dec 04, 2007 10:29 pm Reply with quoteBack to top

This was nice post the one I was looking for.

I did this for mine and and still won't work

Vader I'm sure u knew this question was coming next.. Smile

If I log in in one site once I refresh the other it doesn't recognize the cookie any help.

I did it exactly like bridge did it

I'm using 8.0 though.
Find all posts by SileencerView user's profileSend private message
Sileencer
Nuke Soldier
Nuke Soldier


Joined: Nov 03, 2007
Posts: 10


PostPosted: Tue Dec 04, 2007 10:34 pm Reply with quoteBack to top

The only thing different on mine is that both sites.

are

mydomain.com/site1
mydomain.com/site2


but it should still work right

or only subdomains.?
Find all posts by SileencerView user's profileSend private message
Sileencer
Nuke Soldier
Nuke Soldier


Joined: Nov 03, 2007
Posts: 10


PostPosted: Wed Dec 05, 2007 2:02 am Reply with quoteBack to top

I just tried it out wow it does work its freaking great

It has to be a subdomain. Cool

I think I will say it


I love you guys..
Find all posts by SileencerView user's profileSend private message
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12397


PostPosted: Wed Dec 05, 2007 9:40 am Reply with quoteBack to top

Right, it doesn't work or subdirectories. It has to be subdomains

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.219 Seconds - 186 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::