File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

url rewriting doubt

 
yuvraj kotegar
Ranch Hand
Posts: 120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
URL-rewriting is a way of maintaining a session between an HTTP client and a servlet container which does not use cookies. Rather than exchange a session ID in a cookie, the servlet container includes it in the hyperlink URLs it generates for servlets and JSP.

my doubt is when a servlet returns with URL rewritten. where is the information stored if the cookies are disabled??

how is session tracking happening here??

please can anyone explain how is the session tracking happening??

like for cookie i know that
1> cookies are in server side which are sent to the client side when requested for the first time and is stored in the client machine
2>when the next request is made to the same web server. the stored cookie information will be used.

similarly what happens in URLREWRITING?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The session key becomes part of the URL.
 
sudhir nim
Ranch Hand
Posts: 212
Eclipse IDE Spring Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With URL rewriting, Server uses a key for session tracking. that key is appended to the url as query string. When request is made by clicking on the URL that session key will be available.
 
yuvraj kotegar
Ranch Hand
Posts: 120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so you mean to say that the server will append the session key.

ok then that will be passed to the client.

but if the cookies are disabled then. with the next clent request how will the server identify that the client is same??
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

but if the cookies are disabled then. with the next clent request how will the server identify that the client is same??[/QB]


Hi,

Session object is created on the server, the session id is appended on the url, this is the way of tracking the client. No cookie involved in that.
 
yuvraj kotegar
Ranch Hand
Posts: 120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks chandra,

so nothing is stored in the clients computer right?? in case of URLReWRITING??
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The pages, including the URLs with session key appended, could be cached by the browser.
 
yuvraj kotegar
Ranch Hand
Posts: 120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok. Thanks. for the quick reply
 
yuvraj kotegar
Ranch Hand
Posts: 120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so for example if its a shopping cart example.

then url will be increasing in length as we add more items right?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. Why would you think that?
 
yuvraj kotegar
Ranch Hand
Posts: 120
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok.

but where is the session key generated??
in the client side or the server side??
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by yuvraj kotegar:
ok.

but where is the session key generated??
in the client side or the server side??


session is create and strore in server side
 
Steve Luke
Bartender
Pie
Posts: 4181
21
IntelliJ IDE Java Python
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by yuvraj kotegar:
ok.

but where is the session key generated??
in the client side or the server side??


The data for the session gets added to the server side session. The server creates a jsessionid for the user's session, and only that jsessionid is appended to the URLs when you url-rewrite. When the user makes a new request the server sees that jsessionid and looks up the proper Session to attach to the server-side request.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic