Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

windows.history.back() with tokens

 
abhishek kaul
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi all,

I have a webapp in which i am sending a token every time to server to prevent CSRF, which works fine. In case there is no token present in request or an invalid token the server rejects the request. This works fine.

In some places i have a back button which where i am using windows.history.back() to go to previous page. Problem is it sends previous URL to the server with the previous token which is invalid. Hence server rejects it. Is there a way to set a new token in the windows.history.back() ?? or some other ideas to do this ??


Thanks a lot guys...
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, You have no control over the history.

Eric
 
Victoria Harris
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be you could set some cookie or temporary file with exact instructions. Actually I'm guessing. What kind of application you use, is it custom-made by you?


 
abhishek kaul
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the really late response...

But yeah Eric is right... i can't control history...


I changed it to use same token for entire session. So that works fine now.

Thanks,
Abhishek
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic