Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - 1 cookie for multiple sites
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

1 cookie for multiple sites

 Post Reply Post Reply Page  <123>
Author
SiteMaster View Drop Down
Newbie
Newbie


Joined: 29 August 2005
Location: Denmark
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote SiteMaster Quote  Post ReplyReply Direct Link To This Post Posted: 30 August 2005 at 6:32am
i know it is an old post, but have someone got this to work, and if yes where do i put the 2 lines of code ?
 

Response.Cookies(strCookieName) = 1

Response.Cookies(strCookieName).Domain=".mydomain.com"
 
 
no matter where i put them in the code i get an cookie error when i log on
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 30 August 2005 at 6:39am
what error do you get?

and by "when i log on" are you talking about WebWizForum?

i think you set the .Domain when you set the cookie
S2H.co.uk - WebWiz Mods and Skins

For support on my mods + skins, please use my forum.
Back to Top
SiteMaster View Drop Down
Newbie
Newbie


Joined: 29 August 2005
Location: Denmark
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote SiteMaster Quote  Post ReplyReply Direct Link To This Post Posted: 30 August 2005 at 6:55am

yes when i log on to my forum that is on domain http://forum.sitemaster.dk i get this error

Un-Successful Login

Your login was un-successful due to a cookie problem.

Please ensure that all cookies are enabled on your web browser for this web site.
 
i want it so i can read the cookie from http://www.sitemaster.dk and http://forum.sitemaster.dk
 
 
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 30 August 2005 at 7:07am
yeah, i added it to one of my sites, and am getting the same error

as you said, its an old thread, and am not sure if i ever tried it back then or not - not sure if i get round to it
S2H.co.uk - WebWiz Mods and Skins

For support on my mods + skins, please use my forum.
Back to Top
theSCIENTIST View Drop Down
Senior Member
Senior Member


Joined: 31 July 2003
Location: United Kingdom
Status: Offline
Points: 440
Post Options Post Options   Thanks (0) Thanks(0)   Quote theSCIENTIST Quote  Post ReplyReply Direct Link To This Post Posted: 30 August 2005 at 7:15am
I just get this to work, do this:

1. Create 2 files, coo1.asp and coo2.asp
2. coo1.asp goes into your www.yourdomain.com root
3. coo2.asp goes into your sub.yourdomain.com root

Here's the files for you to copy paste:

<%

'// File 1 - coo1.asp

Response.Cookies("cook") = "Pass me along please!"

Response.Cookies("cook").Domain = ".yourdomain.com"

Response.Write("Cookie set: [ " & Request.Cookies("cook") & " ]")
%>

<%

'// File 2 - coo2.asp

Response.Write("Cookie retrieved: [ " & Request.Cookies("cook") & " ]")
%>


Now open 2 browser windows;

1. On the first one go to [www.yourdomain.com/coo1.asp] make sure it reports cookie set.

2. On the second one, go to [sub.yourdomain.com/coo2.asp] make sure it returns the value of the cookie.

Make sure you change [yourdomain.com] to your actual domain in the code and URLs posted above.

This example works only when sharing stuff between sub-domains part of the same domain not between different domains.

I have encounter a problem when testing this in IE, maybe because of the high security settings I have here, but when testing on Firefox, it worked nicely, so if this don't work for you, could be because you browser is either blocking cookies or not allowing some kinds of it.
Back to Top
SiteMaster View Drop Down
Newbie
Newbie


Joined: 29 August 2005
Location: Denmark
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote SiteMaster Quote  Post ReplyReply Direct Link To This Post Posted: 30 August 2005 at 7:31am
hhmm i reports the text but it did not write the cookie
Back to Top
SiteMaster View Drop Down
Newbie
Newbie


Joined: 29 August 2005
Location: Denmark
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote SiteMaster Quote  Post ReplyReply Direct Link To This Post Posted: 30 August 2005 at 8:00am
i dont get why it is not saving the cookie, if i go to my forum then it save a cookie
Back to Top
theSCIENTIST View Drop Down
Senior Member
Senior Member


Joined: 31 July 2003
Location: United Kingdom
Status: Offline
Points: 440
Post Options Post Options   Thanks (0) Thanks(0)   Quote theSCIENTIST Quote  Post ReplyReply Direct Link To This Post Posted: 30 August 2005 at 8:08am
It's your browser than, it's working, but your browser settings are blocking it at some point, disable all browser security and set it to allow all cookies, exit browser then re-open it again, or use a different browser, as I said above on my IE I couldn't see the cookie value on the second page, but on firefox it works perfectly.
Back to Top
 Post Reply Post Reply Page  <123>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.