Eugene
Eugene

Reputation: 963

Separate webapp session for browser tabs

Is there a way to make a web app handle separate sessions for different browser windows/tabs other than having session id inside the URL? In general form, what are the ways of storing session-id other than cookies and URL parameter?

Upvotes: 0

Views: 450

Answers (2)

MKP
MKP

Reputation: 200

I think you can try do it by using hidden fields in forms, but you have to create hidden form and make all links act as submit button (with some short JavaScript code setting proper value in fields responsible for target), but IMHO it is not the best solution, because all the requests will be using POST method and get all disadvantages of it.

And as question about other methods here is short list.

Upvotes: 1

smcphill
smcphill

Reputation: 826

In short, no. You don't get any tab information from the client; a new browser window is just another client. The only way to differentiate clients is via cookies or parameters. Maybe you could create a tab-named cookie based on the javascript window object ID or something, but I kind of doubt it.

HTML5 (advert click-through, sorry) has some per-tab local storage options, but that probably won't help you right now.

Not sure if you searched before posting, but I found another question like yours - unanswered, but some good advice in the suggestions.

Upvotes: 0

Related Questions