aspose file tools*
The moose likes Servlets and the fly likes jsessionID.... can it be replaced? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "jsessionID.... can it be replaced?" Watch "jsessionID.... can it be replaced?" New topic
Author

jsessionID.... can it be replaced?

Tanu Gulati
Ranch Hand

Joined: Oct 06, 2008
Posts: 113

i have heard that servlet specification says cookie name must be jsessionid and not other than this.

but i have seen some website use some other thing other than jsessionid to identify the same thing for ex. www.irctc.co.in here i have seen some thing like
?BV_SessionID=@@@@0178584902.1242489912@@@@&BV_EngineID=cccdadehfhemfghcefecehidfhfdfko.0


looks like BV_SessionID is same as we have jsessionid.
My question is can we replece the "jsessionid" with and value
what could be the significance of BV_EngineID ..is it some thing related to multiple servers and distributed engines that serve the request .


thanks
Tanu Gulati
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Tanu Gulati wrote:i have heard that servlet specification says cookie name must be jsessionid and not other than this.


i never heard this. i think you are talking about sessionid name while url rewriting. am i right?
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

You can name your own cookie or pass your own session ID to an application. The JSESSION ID however is unique to a J2EE web container and the way it tracks sessions.


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Tanu Gulati
Ranch Hand

Joined: Oct 06, 2008
Posts: 113

i never heard this. i think you are talking about sessionid name while url rewriting. am i right?

yes

The JSESSION ID however is unique to a J2EE web container and the way it tracks sessions.

if jsessionid is unique to j2ee web container then how come i am see the parameters i mentioned above on irctc.co.in i was expecting to see jsessionid but i never saw.

by the way my question is can we NOT use any other variable in place of jsessionid for tracking session?
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 689

Hi Tanu,

I think you are not use another name instead of jsessionid.

Because it generates by the container by automatically when your browser not support cookies.

and it is append with url
? mark
and that character you change according to vendor specific but name always same jsessionid for request.



Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Tanu Gulati wrote:
by the way my question is can we NOT use any other variable in place of jsessionid for tracking session?


if you use tomcat , the sessionid name append in the url-rewriting must be jsessionid . not sure about other container
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16250
    
  21

The jsessionid is not a variable - it's an appendage. If you'll notice, there's a ";" between it and the rest of the URL, including the request variables, which are inrtoduced by the "?".

As far as I can remember without checking, it's stripped off before any of the HttpServletRequest methods can ever even see it.

There's no point in mucking around with it. All it - or any J2EE session IDs - really is is a handle by which the server can match the session with a given client. There's no formal spec about what that ID should be, how it should be formed, of even if the same ID should be passed on each request/response cycle. jsessionid hacks that work on one server may not work on another. Or even a different version or configuration of the same server.


Customer surveys are for companies who didn't pay proper attention to begin with.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
Consider the possibility that the application you asked about is not using the standard API at all, but substituting its own "session" mechanims.

With Java serialization this is easy to do.

Bill
Tanu Gulati
Ranch Hand

Joined: Oct 06, 2008
Posts: 113

mm....looks like the url in question is using their own session mechanism ...thanks William
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: jsessionID.... can it be replaced?