![]() |
Restrictions on session only cookies
Is it ok to have more than one session cookie on a page/site (obviously with different names)? Are there any restrictions on this or any special actions to take?
I ask because I've one session cookie working perfectly, but the second one just doesn't want to work. |
Yes there is a limit on cookies. I think all browsers limit them to 20 per domain.
Some browsers IE, opera have a 4K limit on the total amount of space taken up. I'm sure you don't max this out with only two. Post code for the setting and reading of these cookies please. |
Code:
<script type="text/javascript">For clarification, zoomLetter allows the user to increase or decrease the font size, one px at a time, between 14 and 24px. I get the impression that either the cookie isn't stored or isn't called when the new page opens. |
The first thing when loading a page is to look for the cookies. You could use:
<body onload="checkCookie()"> reading a cookie is not a straight foreword thing. read this http://www.w3schools.com/js/js_cookies.asp P.S. I used Firefox to check for the cookies and yours are set. |
Quote:
Quote:
http://www.javascriptkit.com/javatutors/cookie.shtml Quote:
|
zoomLetter(mysize) does not seem to be working so I just made up a value of 2 to get a cookie for it. Your functions to make a cookie are the top two functions. I then added the w3shools code for reading them. did a on load thing and instead of changing the font and bgcolor I just used an alert to show you what the cookies are set to.
You can change the magnif to what ever you want to check it. But this is how it's done. Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
Thanks very much, sunfighter, that did the trick...after a couple of weeks of my struggling on my own.
|
| All times are GMT +1. The time now is 07:31 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.