| Author |
Topic Search Topic Options
|
Sumea
Newbie
Joined: 18 September 2006
Status: Offline
Points: 30
|
Post Options
Thanks(0)
Quote Reply
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!
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
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.
|
|
|
 |
Sumea
Newbie
Joined: 18 September 2006
Status: Offline
Points: 30
|
Post Options
Thanks(0)
Quote Reply
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
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
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.
|
|
|
 |
Sumea
Newbie
Joined: 18 September 2006
Status: Offline
Points: 30
|
Post Options
Thanks(0)
Quote Reply
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
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
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.
|
|
|
 |
Sumea
Newbie
Joined: 18 September 2006
Status: Offline
Points: 30
|
Post Options
Thanks(0)
Quote Reply
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
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
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.
|
|
|
 |