Print Page | Close Window

Reading cookie problem

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=23894
Printed Date: 06 April 2026 at 9:13pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Reading cookie problem
Posted By: Sumea
Subject: Reading cookie problem
Date 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!



Replies:
Posted By: WebWiz-Bruce
Date 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.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: Sumea
Date 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 ?


Posted By: WebWiz-Bruce
Date 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.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: Sumea
Date 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.


Posted By: WebWiz-Bruce
Date 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.

-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: Sumea
Date 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 http://www.15seconds.com/issue/971108.htm - sharing cookies across subdomains


Posted By: WebWiz-Bruce
Date 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.

-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: Sumea
Date Posted: 24 July 2007 at 1:34pm
ahh, I must be confusing you, since I am confusing myself also. :)

Currently, wwf saves cookies like this:

NameWWF9sLID
ValueUID=MembernameZ457BDEAA3
Hostforum.mywebsite.com
Path/
SecureNo
ExpiresAt End Of Session

How would I get WWF to write its cookies so that the host detail is ".mywebsite.com" instead of "forum.mywebsite.com" ??


Posted By: WebWiz-Bruce
Date Posted: 24 July 2007 at 1:37pm
For that you will need to edit the functions/functions_common.asp and look for the cookie handling functions and change the code to include the Host as it's currently not set by the software.

-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: Sumea
Date Posted: 24 July 2007 at 2:08pm
Brilliant! I have it working now, thanks

Sorry for the confused posts, I had to read a bit about cookies across subdomains, and I got a bit mixed up with the path and host settings of WWF's cookies, but I can now reference "strLoggedInUsername" or "strLoggedInUserCode" anywhere and across subdomains on my site now!


Posted By: BLoodyEsk
Date Posted: 21 August 2007 at 3:11pm
hi,
 
is there any way to catch the logged user's ID number ,from a session variable or session cookie ?
 
there are some cookies for username or usercode in cookies, but I couldn't find ID number



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net