Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reset session values for a browser

 
Praveen Banthia
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I believe this is super common problem
My server has started now problem is when I am opening the game in two browsers the values of one browser is affecting value of another browser no sir this is unacceptable.
Where should I write intial values on my server such that is does not need to restart server every time I wanna play.
Opening game in new browser resets all values to intial values ;


Thanks IN ADVANCE

HELPPPPPPPPPPPPPp
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64970
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depending upon the browser and how you open the windows. Some windows will share cookies and therefore the session.
 
Praveen Banthia
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear I am really sorry I did not the norms of form writing and I will be careful in future.

But my problem is I have initially declared a few values now problem is these values are shared over multiple browser which I do not want.
but I cannot keep the values inside doget() or dopost () method as it will be reset every time user is redirected to same page in browser can some give me a suggestion on this

I am making a game a game and intially setting sum to 0 and opening in two browsers now both browsers are having same value which is not desirable can some one please suggest any advice on it.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64970
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you expecting end users to open two browsers? (and if they do, do you really care?) Or is this just a problem during development? If the latter, just use two different browsers. You need to test in multiple browser types anyways.
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Multiple windows of same browser from the same machine should imply the same user right? So what you have right now is the correct way of handling it.
I mean if the two windows show different stats, that would mean the player is playing multiple games at once.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic