• 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

Analogue for PHP's $_SESSION - suggestions?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm porting a code base from php. PHP which provides global variable to reference $_SESSION functionally not entirely unlike a static reference to the HttpSession of the current request.

I can't help thinking a mapping from the servlet thread to the session populated by a filter. Assuming the thread that runs the filter is the thread the runs the servlet it might work.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rather that trying to map PHP concepts to Java Servlets architecture I think you should back off a kilometer or so and look at the general architecture involved.

You should be very wary of creating ANY static reference related to user state.

Bill
reply
    Bookmark Topic Watch Topic
  • New Topic