File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Reset session values for a browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Reset session values for a browser" Watch "Reset session values for a browser" New topic
Author

Reset session values for a browser

Praveen Banthia
Greenhorn

Joined: Apr 26, 2013
Posts: 13
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

Joined: Jan 10, 2002
Posts: 61180
    
  66

Depending upon the browser and how you open the windows. Some windows will share cookies and therefore the session.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Praveen Banthia
Greenhorn

Joined: Apr 26, 2013
Posts: 13
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

Joined: Jan 10, 2002
Posts: 61180
    
  66

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

Joined: Jun 06, 2007
Posts: 2716
    
    6

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.


SCJP, SCWCD.
|Asking Good Questions|
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reset session values for a browser