[SOLVED] Different context or session for each browser tab

Answered Closed
0
0

Hi,

Is it possible to have different context or session for each browser tab as it was in vwg with vwginstance keyword?

Best regards,

  • You must to post comments
Best Answer
1
1

Yes, there are two (maybe more) ways:

  • Wisej creates a new session when the arguments in the URL are different. So you can create a new session simply by adding ?any_name=a_new_value. i.e. http://localhost/myapp?session=13124, http://localhost/myapp?session=877348… the number or string can be random, a timestamp, a gui, your own value. Wisej will preserve the session on a refresh when the URL matches.
  • Other way (similar to VWG): you can enable cookieless sessions in the app JSON: “cookieless”: true. When the session starts Wisej will add it to the URL. http://localhos/myapp becomes http://localhos/myapp?sid=fd12b081-5d4a-4cae-a513-47543f694f4c. This is preserved on a refresh. But you type or link the url to a new tab, Wisej automatically creates a new session and adds it to the URL.

HTH

Best,

Luca

  • You must to post comments
0
0

Any chance of adding an option for when the Default.json file contains:

 

“cookieless” : true

To say something like:

“embeddSID” : true

So that the sid=GUID is contain in the page instead of the URL ???

It would make for a lot cleaner URL’s and make it easier when additional parameters are used on the URL.

  • Luca (ITG)
    The only reason to have it the URL is to preserve the session on a Refresh or F5. Otherwise each refresh (or a retry after a network loss) would create a brand new session.
  • You must to post comments
0
0

Yes, my bad. It was like that but it was changed. Now the new set of arguments is updated instead of reloading a new session. This lets your code process different arguments in the URL without recreating the session. Changing the URL causes a reload anyway. You can get notified of a refresh or change of arguments by attaching to:

Application.ApplicationRefresh += ...

The arguments in the URL are available using this collection:

Application.QueryString

 

If you use “sid” and “cookieless” is false when you hit refresh Wisej will always start a new session since sid is invalid. In fact that is a “trick” to use when debugging to force the start of a new session. I add “?sid=new”.

  • You must to post comments
0
0

Hi Luca,

I’ve tested the ways you explained,

“cookieless sessions” option runs very well as you explained.

On the other hand, may the first option run a bit different? If I use url argument name “sid” with any value (sid=1, sid=anyvalue) it’s ok, every tab starts a new context/session  from the beginning as the first option. But if I use random argument name and value (abc=1, xyz=anyvalue),  new tabs starts with previous tab’s state.

Serkan,

  • You must to post comments
Showing 4 results