Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session for static pages

 
Veena Pointi
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the book it is given that URLRewriting won't work with staic pages,coz there is no way for dynamically generating sessionId..So session fails if cookies are not enabled,static pages are being used......Just wanted to make sure,session wont fail for static pages if cookies are enabled right?

Thanks
Veena
 
Chandra Sagi
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just wanted to make sure,session wont fail for static pages if cookies are enabled right?


From the explaination in the book I understood that URL rewriting is not possible for static pages. Cookies require URL rewriting as a starting point, for the server to know that Client accepts cookies. So, I dont think we could have sessions for static pages even when cookies are enabled.

Thanks
Chandu
 
Veena Pointi
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Chandra Sagi:


Cookies require URL rewriting as a starting point, for the server to know that Client accepts cookies.


I thought cookies and URL rewriting are 2 independent things.Container uses either cokies r URL rewriting as a means to exchange sessionId between itself and the client....The only way for server to know that client doesn't accept cookies is,when it doesn't find value for Cookie in request,then it switches to URL rewriting..

Originally posted by Chandra Sagi:


So, I dont think we could have sessions for static pages even when cookies are enabled.


I think if cookies are enabled,container uses cookies as means to exchange sessionId.So we should be able to use session for static pages.

Please correct me if I understood wrong.

Thanks
Veena
 
Chandra Sagi
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A better explaination on your questions is in pg's 236 and 237 of HFSJ. It should be clear reading that, else you can get back anytime.

Thanks
Chandu
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I think if cookies are enabled,container uses cookies as means to exchange sessionId.So we should be able to use session for static pages.


The session is between user and application. The session is valid for the user once created in the application. So when the static page is encounter from the user from the current session, the session is still valid for the user, but you can not use the session in static page anyway, because the page is static and there is no dynamic content.

In case of session, generally the containers checks for the cookies first. If cookies are disabled then only it URL rewiting. So when the static page is encountered, as there no way to generate the dynamic sessionID. We can not use it in static page.

Hope it helps

Thanks
 
Veena Pointi
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks all for replieng.Now I understand.Sessions can not be used for static pages irrespective of weather cookies or URL rewriting is used for session.Realized the following just now.

<b>Because when Cookies are used getSession is the method that is responsible for creating JSESSIONID and setting it as cookie in response header.This we can not include in static HTML page.</b>

Somebody correct me if I am wrong.

Thanks
Veena
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic