• 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

bookmarking pages

 
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i read in the earlier posts that I should use tokens to avoid bookmarking of pages.
but in my situation i have action chaining so when i pass from action1 to action2, im guessing the request is reset and the token is invalid.
what is the best way around this.
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The token only resets when you call saveToken or resetToken (you'll usually call saveToken). If you never change the token, the same one is kept for an entire session.

You should have no problems with tokens even though you are chaining actions, Mannu.
 
Pranav Sharma
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So, Marc(or anybody else) this should work or am I doing something wrong

in action1:
save data from page 1 form
saveToken(request);
forward to action 2

in action 2:
if(isTokenValid(request))
then "get data from db for new page"
resetToken(request);
saveToken(request);
forward to page 2
 
Marc Peabody
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IMO it's better like this:

in action1:
if(!isTokenValid(request)) > add ERROR and forward somewhere
save data from page 1 form
saveToken(request);// this does change token, by the way
forward to action 2

in action 2:
"get data from db for new page"
forward to page 2
 
Pranav Sharma
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
din't know what i was thinking, that makes much more sense.
Thanks.
[ September 09, 2005: Message edited by: mannu kapoor ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic