This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Sessions  RSS feed

 
Tom Joiner
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to use sessions to keep track of when a user is logged in to the website. It is only working on pages which are redirected from the one where the session is set- it does not work if the user links to a new page.

So my first page has the following code (which has been gotten from the database successfully). It redirects to another page




This new page works, in that it can extract the friendlyName and accountID, like this



However, this same code on any other page, does not work. If you press a link to go to another page, it does not see the friendlyname.

Any ideas?
[ March 05, 2007: Message edited by: Tom Joiner ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66187
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before anything else, why are't you just using the session builtin variable?
 
Bosun Bello
Ranch Hand
Posts: 1512
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are sending a redirect which asks the client(browser), to make initiate a new request to the associated URL.

As Bear suggested, you do should just be using the session built in variable. No need for a redirect. As long as they are bot part of the same session it should see the attributes set by the first servlet.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!