# About "session" in pqServerResource

**URL:** https://discourse.paraview.org/t/about-session-in-pqserverresource/9414
**Category:** Development
**Created:** [April 12, 2022, 2:37pm UTC](https://discourse.paraview.org/t/about-session-in-pqserverresource/9414 "2022-04-12T14:37:10Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [April 12, 2022, 2:37pm UTC](https://discourse.paraview.org/t/about-session-in-pqserverresource/9414/1 "2022-04-12T14:37:10Z")

</div>

In ParaView, all “resource” are reprsented as pqServerResource, which can be converted to an URI and is stored in the settings of ParaView so that they can be presented in the “recently used resources” menu.

The current URI scheme is as follows:  
`scheme://host:port/path/to/file:DATA:VAL`  
eg:  
`cs://localhost:11111/path/to/cow.vtp`

There is one exception though, “session” resource, which are only used for paraview state files and where the URI is as follows:  
`session:/path/to/statefile.pvsm#cs://localhost:11111;PARAVIEW_STATE_FILE:1`

The usage of `PARAVIEW_STATE_FILE` is perfectly justified as a state file is not loaded like a data file and require special processing.

The `session` scheme however seems not justified. It uselessly increase the complexity of each code reading the URI of a resource and does not seems required. It would be perfectly fine to have instead:

`cs://localhost:11111/path/to/statefile.pvsm;PARAVIEW_STATE_FILE:1`

There is already a working branch for this, however, it would mean a small breaking change.  
C++ Method deprecation is possible however, with the new implementation, someone recovering the URI of the resource and expecting a `session` scheme would never get it.

This is a fairly minimal breaking change, but I want to make sure this is fine for everyone before going ahead.

FYI, this change in the end will add the serverName in the URI, allowing to have resource by serverName instead of by host and port.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [April 12, 2022, 2:37pm UTC](https://discourse.paraview.org/t/about-session-in-pqserverresource/9414/2 "2022-04-12T14:37:26Z")

</div>

FYI @utkarsh.ayachit @cory.quammen

---

<div class="post-metadata">

### Author: ![timothee.chabat](https://discourse.paraview.org/user_avatar/discourse.paraview.org/timothee.chabat/32/5729_2.png) [@timothee.chabat](https://discourse.paraview.org/u/timothee.chabat)
#### Post date: [April 13, 2022, 7:06am UTC](https://discourse.paraview.org/t/about-session-in-pqserverresource/9414/3 "2022-04-13T07:06:16Z")

</div>

If the `session:` scheme is useless then removing an exception looks good to me. Keeping the retro compat would be nice though.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [April 13, 2022, 7:19am UTC](https://discourse.paraview.org/t/about-session-in-pqserverresource/9414/4 "2022-04-13T07:19:41Z")

</div>

> [@timothee.chabat](#):
>
> Keeping the retro compat would be nice though.

Thats just not possible to be fully retro compat. I cant remove the `session` scheme and at the same time provide an URI with the `session` scheme.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [April 21, 2022, 12:40pm UTC](https://discourse.paraview.org/t/about-session-in-pqserverresource/9414/5 "2022-04-21T12:40:30Z")

</div>

Merged in ParaView in [https://gitlab.kitware.com/paraview/paraview/-/merge\_requests/5627](https://gitlab.kitware.com/paraview/paraview/-/merge_requests/5627)
