• 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

Session Handling without Cookies

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I use Mojarra 2.1.2 under Tomcat 7.0.12. I want to write a JSF application using facelets that also works with cookies disabled in the client. Only using servlets and JSP, this works perfectly, you only have to response.encodeURL each URL which is displayed to not loose the current session.

How to manage that in JSF?

I have a simple facelet, say demo.xhtml, wich contains something like this

<h:form>
<h:commandLink value="Login" action="#{bean.doSomething()}" />
</h:form>

With cookies enabled, clicking on the link works as desired and the content of the doSomething() method of the ManagedBean bean (in RequestScope) is executed. However, clicking on the link after disabling cookies raises viewId:/facelets/demo.xhtml - View /facelets/demo.xhtml could not be restored.

The source obtained via the browser shows that there is no sessionid appended to the link. Then the server cannot identify the session any more.

The same with a <h:commandButton>, and with Glassfish 3.1 and its own JSF Library.

Does anyone have an idea what I am missing to not lose sessions without cookies?

Thank you.

Chris
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic