Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Reading cookie problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Reading cookie problem

 Post Reply Post Reply Page  12>
Author
Sumea View Drop Down
Newbie
Newbie


Joined: 18 September 2006
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sumea Quote  Post ReplyReply Direct Link To This Post Topic: Reading cookie problem
    Posted: 23 July 2007 at 4:21pm
Ahh, I think I may have a small problem reading the forum's cookies. I'm putting "common.asp" in the header of all my non-forum pages (they're outside the forum directory), and I can't read the "strLoggedInUsername" or "strLoggedInUserCode" variables on my non-forum pages. I can pick them up properly if they're placed in the forum directory, of course.

This is where I think I may have messed up. I bought the license and registered with an url like forum.mywebsite.com, instead of the usual www.mywebsite.com ... I'm guessing that the forum cookies can only be read from forum.mywebsite.com, and not www.mywebsite.com ? If I change my license (which I'm hoping I can avoid the hassle for both myself and the people behind WWF), will this solve my problem?

If anyone has a solution, that would be greatly appreciated!
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2007 at 4:33pm
You would need them to be running on the same site to do this type of thing. For security reasons browsers don't let cookies be shared between domains.

If you have any licensing questions they need to be sent to Sales and Accounts using the contact information on the main site.
Back to Top
Sumea View Drop Down
Newbie
Newbie


Joined: 18 September 2006
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sumea Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2007 at 5:41pm
Can cookies, for example, that are set at forum.website.com be read from a page at www.website.com? They're separated by a subdomain, but other wise they're on the same site.

I can see that the cookie has been set  with the domain as forum.website.com, but I can't seem to get the correct  login variable information in my page at www.website.com which has the include forum/common.asp.

** update
Ok, did a tiny bit of researching, and it looks like you can share cookies across subdomains, but your cookie has to be set to your domain like ".website.com" rather than  "www.website.com" or "forum.website.com".  So, the question  how do I get WWF to set the url in its cookies like ".website.com" :/

I think WWF sets cookies in "/", which when set from a page at forum.website.com means that it will only be readable at folders and pages below that and not from outside like www.website.com ?


Edited by Sumea - 23 July 2007 at 6:25pm
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2007 at 8:35am
Web Wiz Forums sets the cookies to the location of your forum as it makes the cookies work better and less issues with login problems.

You can alter the cookie path by editing the includes/setup_options.asp file.
Back to Top
Sumea View Drop Down
Newbie
Newbie


Joined: 18 September 2006
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sumea Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2007 at 12:29pm
Yeh, I've made strCookiePath =  ".mywebsite.com" so that the cookie can be read across all subdomains and from the main site etc, but I get this error when I try to log in.. :(

Error: Un-Successful Login Your login was un-successful due to a session tracking error.

Please ensure that cookies are enabled on your web browser and you are not hiding or masking your IP address.


Edited by Sumea - 24 July 2007 at 12:50pm
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2007 at 12:46pm
Thats doesn't look correct as a cookie path, and the error you are getting will be because the forum can't correctly set the cookie for your site.
Back to Top
Sumea View Drop Down
Newbie
Newbie


Joined: 18 September 2006
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sumea Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2007 at 12:52pm
Previously, I logged in and changed my cookie information via that Firefox web developer plug in, so that it read ".mywebsite.com", and my test pages outside the forum directory and on other subdomains (which includes the common.asp file) read it properly. How would I get the login to accept the ".mywebsite.com" as the strCookiePath variable?

".mywebsite.com" is a valid path, check out sharing cookies across subdomains
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2007 at 1:17pm
The simplest way is use Firefox to view the cookie set by the forum and see if it is how you want it to be set.
Back to Top
 Post Reply Post Reply Page  12>

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.