views:

43

answers:

5

I would like to send some sort of token on one request and store it at the client but not have that token retransmitted on subsequent requests.

+1  A: 

Putting the token on the web page would "store" it on the client. If you don't want it retransmitted, this seems ideal, since it will only be stored until the browser page cache is cleared.

Maybe you should explain why you want to do this.

wallyk
+1  A: 

If you are sending the data to user in cookie then data will be retransmitted of every subsequent request.. There is no a way to send data to user in cookie but not have the data retransmitted with every subsequent request........

giri
+1  A: 

Might your goal be achieved with a session? You send the user a small token (a session ID) and subsequent page loads send only that session ID back to the server. You can then use the session to store (potentially much larger amounts of) data server-side.

fennec
+1  A: 

Ways for the HTTP client to not return the cookie to the HTTP server:

  • The HTTP client could have support for cookies disabled.
  • The HTTP client could delete the cookie.
AJ
A: 

You can do it by manipulating the paths of the cookie and processing URLs - if you set your cookie with a path '/some/obscure/dir' then the cookie will only be included in requests to URLs starting with /some/obscure/dir

symcbean
that's an interesting idea.would the value stored be available from any url though? or would it be limited to addresses under <code>some/obscure/dir</code>?
Matt
Just to URLs under /some/obscure/dir
symcbean