Forum Moderators: open

Message Too Old, No Replies

Why is only half my cookie being saved?

         

webworker us

1:01 pm on Jun 16, 2006 (gmt 0)

10+ Year Member



Hi All,

I am using cookies to remember if a user has already logged in. Therefore, I set a huge list of cookie values (one for each of the databases they are logged into).

However, only 1.94kb of the cookie is set. It cuts of end values of my for loop.

Any suggestions?

oxbaker

6:18 pm on Jun 16, 2006 (gmt 0)

10+ Year Member



you could have two problems

1) your code is messed up and breaks during its loop.

2) Client side cookies only can store 4k (4096 bytes). If your breaking at 2 it may realize that the chain of text in the cookie can only be broken up at that part, and keeping all of it will eclipse the 4kb limit.

My suggestions.

1) make sure your source is fine.
2) Revamp the cookie to either store numerical representations of the databases, or try to reduce the overall size of data your putting in the cookie by trimming away unnecessary characters.

Remember, cookies are not the best ideas to store so much data. Perhaps you can store nothing more than a lookup value in the cookie, then have that hit a db or something that has a better formatted version of logged in databases.

hth,
mcm

webworker us

6:25 pm on Jun 16, 2006 (gmt 0)

10+ Year Member



Thanks for the response. I think I'm hitting several problems really. I may be hitting the 20 cookie per domain limit though I think I have backed away from the 4k. The reason I say the 20 limit is that when I tell my loop to make fewer cookies, it works like a dream. However, I'm only making 15 cookies (I think). If you know how I can exactly count them I would be greatful. (I assumed it was when you change the master name ie response.cookies("master")("blah")).

The reason I'm doing it this way (believe me I'd love to do it differently) is that most of our database stuff has been built in ASPmaker. For their security settings, we have to use cookies...Unless I misunderstand. I have a post active on the ASPmaker site asking about it, but so far no response.

Thanks,

Casey

oxbaker

12:17 am on Jun 18, 2006 (gmt 0)

10+ Year Member



i dont know anything about ASPMaker but I do know that no db program worth a salt will use a cookie for security settings, are you sure thats correct? I would suggest contacting technical support at ASPMaker or read the docs on connecting to a db, because using a cookie is definately not an approach any developer would use.

hth,
mcm

webworker us

5:35 pm on Jun 18, 2006 (gmt 0)

10+ Year Member



I think I should have been a bit clearer earlier in the post. When I say they use it for security, what I meant to say was that they use cookies for autologin and remembering users.

I have since also discovered that my problem is the 20 cookie per domain limit. I think as a work around, I'll be creating each cookie on a database by database basis that way each user only has one cookie at a time.

Thanks,

Casey

oxbaker

3:24 pm on Jun 19, 2006 (gmt 0)

10+ Year Member



that sounds like a good idea.

mcm