• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

URL-rewriting

 
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have confusion in understanding URL re-writing.Please check it is correct or not?

Http protocol is stateless protocol.Server not able identify the clients.So cookies are use as meduim by the server to share session id from client to server.
The main goal is to establish session between client and server.

suppose client is not accepting cookies.assume that user is sending first request by clicking on the link "click me" to server.

Q1) what are the steps the container will do?

1) Container will create unique session id for a client and suff session id in cookie and will send back to the client.
2) Now client is not accepting cookies: Now how container will come to know that client is not accepting cookies?
3) At time server send his first response to the client it tries both cookie as well as url re-writing(Assume url encoded)
4) At client side[browser] is not able add session to the cookie that client received. Session id is appended at the end of URL (Because of reponse.encodeURL).
5) Now herafter server starts using url -rewriting.


Q2)Please let me know if there are any steps missing in between?

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Step 3 is crucial - the server tries both cookies and URL rewriting. By the time the second client request comes in, there are two possibilities:
a) it contains a cookie - the server can henceforth use the cookie, and doesn't need to perform URL rewriting
b) it does not contain a cookie - the server must continue to use URL rewriting, since cookies are not used by the client
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic