Re: Sharing same cookie between server and client

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Feb 15, 3:09 pm, "Anthony Jones" <A...@xxxxxxxxxxxxxxxx> wrote:
<arijit...@xxxxxxxxx> wrote in message

news:9a7be1fe-007f-4d25-95c9-2bd8848d682a@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Hi,

We have an ASP.NET 2.0 web application where we want to share few user
specific databetweenserverandclientside code usingcookie. We are
seeing a very strange behavior that it does not work consistently.
Sometimes we are getting the latest value set fromserverinclient
script, sometimes were are getting a wrong (previously set old) value.
In other words, the values inclientandserveris not in sync.

Can anybody suggest what are the parameters we should be checking to
debug this? We are using the same cookie name with the same 'path' in
both server and client side code. Client browser IE6.

Have you got a small repro for this I can't reproduce it. IE always has the
latest value of the cookie as sent by the server, and I can't see a way the Server won't send a Set-Cookie header when the cookieis modified.

Is it possible that where you expect a cookie to be changed by server side
code serving a request it isn't because a cache is supplying the response
instead. Could be the client cache, a proxy or even the Response cache on
the server.

--
Anthony Jones - MVP ASP/ASP.NET

Yes, Anthony I was also thinking that the client cache might be
causing the problem, but again that seems to be unusual... Can you
please suggest a way to check this or a fix for this? I tried by
cleaning the browser cache. No luck.

Here's a bit more details of the problem: We have a page/code (say
Page1.aspx) that gets called for all client request and we apply
custom user authorization there. We are using a cookie to keep the
user credential information (combination of form authentication cookie
and some other custom information). This cookie is shared between
global.asax, Page1.aspx and client script. We create the cookie in
Page1.aspx, update it conditionally in global.asax and read it from
client script. When we try to read the value in client script, we are
seeing that it's having the value set in Page1.aspx. Even if we are
modifying the same cookie in global.asax, that value is not reflecting
in client script. As an alternative, if we create a new cookie from
global.asax, we can easily get the correct value. But we don't have
any clue of why it's behaving that way!
.



Relevant Pages

  • Re: Cache size error occuring on local clients
    ... client's cache. ... I believe there is a script demo in the SMS2003SDK. ... the cache size to 500MB local space (time to download to client) ... > We are receiving the following error message. ...
    (microsoft.public.sms.admin)
  • Re: Force caching of credentials
    ... cache the credentials locally on the client prior to shutdown or logoff. ... would be like a shutdown script... ... Credentials are cached during the logon process. ... There isn't any way for them to be cached at shutdown and I don't think there's an API to control the caching process, e.g., to force a particular account to be kept in the cache or to store a particular set of credentials. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: (spam)secure mailform
    ... that is not 100%...for example a script can easily send the ... teh existence and validate the cookie upon script run 2)check the cookie of the one requesting the form in the first place and save that in the cookie, if no cookie when the script submission is carried out:or error arguments in it:spammer ... simply unpack and validate upon script run. ... It's secure because the email address is not in the web page, cookie, session information or any other place the client can access. ...
    (comp.lang.php)
  • Re: Increasing Cache size on Advanced Clients
    ... Someone in a 2596 class found this script on usenet. ... ' Sets Adv Client Cache to 800MB if not already ... Must be ran on client. ... This is an SMS limitation! ...
    (microsoft.public.sms.admin)
  • Re: cookie problem.
    ... I have a C++ client, communicating with a perl script over http. ... sending the cookie back to the script causes the script to crash. ... If you enable lynx's "trace" mode, it outputs into its trace file a verbatim copy of the HTTP request it sends. ...
    (comp.lang.perl.misc)