Hi Team,
i designed a service that uses web tokens to identify the users and i try to run this service really stateless, that says without creating any sessions. The service runs as basexhttp and uses Jetty. Is there a parameter, that prevents it from creating sessions at all?
Currently curl writes:
< HTTP/1.1 406 Not Acceptable < *Set-Cookie: JSESSIONID=1tgnabd2l6y3p1jpg8qv3hb53d;Path=/* < Expires: Thu, 01 Jan 1970 00:00:00 GMT < Content-Type: text/plain;charset=UTF-8 < Content-Length: 19 < Server: Jetty(8.1.18.v20150929)
and the service adds a new session per call:
sessions: "1gnn17n91gsmuc9grvk417ne 1xim2bo4bmtvr11e4a8tap8cl8 kiy3rq9j5lyq1hf6gf8vy4td2 s5luvfkvdpjv19ikpzqeev9k2 mn50c33fxflz17jv24oc68baw 1tgnabd2l6y3p1jpg8qv3hb53d"
Best regards,
Christoph
Dear Christoph,
I’m glad to read that you are still working with BaseX. I checked our code base, and I noticed that the default session creation in RESTXQ was introduced with the introduction of the %rest:single annotation in version 8.4 [1,2].
I will check out if we can simply get rid of the session creation in version 9 (for those cases in which in which no %rest:single annotation is specified). Would this work for you, or do you require a solution for the stable 8.x version?
All the best, Christian
[1] http://docs.basex.org/wiki/RESTXQ#Query_Execution [2] https://github.com/BaseXdb/basex/commit/e7c1ea0db109e43fa6865bd5072107c91c20...
On Tue, Jan 30, 2018 at 9:26 PM, Christoph Gaukel christoph.gaukel@gmx.de wrote:
Hi Team,
i designed a service that uses web tokens to identify the users and i try to run this service really stateless, that says without creating any sessions. The service runs as basexhttp and uses Jetty. Is there a parameter, that prevents it from creating sessions at all?
Currently curl writes:
< HTTP/1.1 406 Not Acceptable < Set-Cookie: JSESSIONID=1tgnabd2l6y3p1jpg8qv3hb53d;Path=/ < Expires: Thu, 01 Jan 1970 00:00:00 GMT < Content-Type: text/plain;charset=UTF-8 < Content-Length: 19 < Server: Jetty(8.1.18.v20150929)
and the service adds a new session per call:
sessions: "1gnn17n91gsmuc9grvk417ne 1xim2bo4bmtvr11e4a8tap8cl8 kiy3rq9j5lyq1hf6gf8vy4td2 s5luvfkvdpjv19ikpzqeev9k2 mn50c33fxflz17jv24oc68baw 1tgnabd2l6y3p1jpg8qv3hb53d"
Best regards,
Christoph
Dear Christian,
Version 9 will work for me! Creating needless sessions means a small overhead in space, bandwidth and calculation time. No problem to live with for some weeks or even months. But I wonder if only the annotation %rest:single uses sessions. For me it would be fine if there was an explicit switch to omit them.
Best regards
Christoph
Am 31.01.2018 um 12:49 schrieb Christian Grün:
Dear Christoph,
I’m glad to read that you are still working with BaseX. I checked our code base, and I noticed that the default session creation in RESTXQ was introduced with the introduction of the %rest:single annotation in version 8.4 [1,2].
I will check out if we can simply get rid of the session creation in version 9 (for those cases in which in which no %rest:single annotation is specified). Would this work for you, or do you require a solution for the stable 8.x version?
All the best, Christian
[1] http://docs.basex.org/wiki/RESTXQ#Query_Execution [2] https://github.com/BaseXdb/basex/commit/e7c1ea0db109e43fa6865bd5072107c91c20...
On Tue, Jan 30, 2018 at 9:26 PM, Christoph Gaukel christoph.gaukel@gmx.de wrote:
Hi Team,
i designed a service that uses web tokens to identify the users and i try to run this service really stateless, that says without creating any sessions. The service runs as basexhttp and uses Jetty. Is there a parameter, that prevents it from creating sessions at all?
Currently curl writes:
< HTTP/1.1 406 Not Acceptable < Set-Cookie: JSESSIONID=1tgnabd2l6y3p1jpg8qv3hb53d;Path=/ < Expires: Thu, 01 Jan 1970 00:00:00 GMT < Content-Type: text/plain;charset=UTF-8 < Content-Length: 19 < Server: Jetty(8.1.18.v20150929)
and the service adds a new session per call:
sessions: "1gnn17n91gsmuc9grvk417ne 1xim2bo4bmtvr11e4a8tap8cl8 kiy3rq9j5lyq1hf6gf8vy4td2 s5luvfkvdpjv19ikpzqeev9k2 mn50c33fxflz17jv24oc68baw 1tgnabd2l6y3p1jpg8qv3hb53d"
Best regards,
Christoph
Hi Christoph,
I absolutely agree that it would be good to avoid sessions if they are not required, or requested by the client.
And I’m positive that the new snapshot already does what we want [1]: Sessions will only be created now if %rest:single is specified, or if one of the Session(s) Module functions [2] will be invoked in the RESTXQ code.
Hope this helps, Christian
[1] http://files.basex.org/releases/latest/ [2] http://docs.basex.org/wiki/Session_Module
On Wed, Jan 31, 2018 at 9:21 PM, Christoph Gaukel christoph.gaukel@gmx.de wrote:
Dear Christian,
Version 9 will work for me! Creating needless sessions means a small overhead in space, bandwidth and calculation time. No problem to live with for some weeks or even months. But I wonder if only the annotation %rest:single uses sessions. For me it would be fine if there was an explicit switch to omit them.
Best regards
Christoph
Am 31.01.2018 um 12:49 schrieb Christian Grün:
Dear Christoph,
I’m glad to read that you are still working with BaseX. I checked our code base, and I noticed that the default session creation in RESTXQ was introduced with the introduction of the %rest:single annotation in version 8.4 [1,2].
I will check out if we can simply get rid of the session creation in version 9 (for those cases in which in which no %rest:single annotation is specified). Would this work for you, or do you require a solution for the stable 8.x version?
All the best, Christian
[1] http://docs.basex.org/wiki/RESTXQ#Query_Execution [2] https://github.com/BaseXdb/basex/commit/e7c1ea0db109e43fa6865bd5072107c91c20...
On Tue, Jan 30, 2018 at 9:26 PM, Christoph Gaukel christoph.gaukel@gmx.de wrote:
Hi Team,
i designed a service that uses web tokens to identify the users and i try to run this service really stateless, that says without creating any sessions. The service runs as basexhttp and uses Jetty. Is there a parameter, that prevents it from creating sessions at all?
Currently curl writes:
< HTTP/1.1 406 Not Acceptable < Set-Cookie: JSESSIONID=1tgnabd2l6y3p1jpg8qv3hb53d;Path=/ < Expires: Thu, 01 Jan 1970 00:00:00 GMT < Content-Type: text/plain;charset=UTF-8 < Content-Length: 19 < Server: Jetty(8.1.18.v20150929)
and the service adds a new session per call:
sessions: "1gnn17n91gsmuc9grvk417ne 1xim2bo4bmtvr11e4a8tap8cl8 kiy3rq9j5lyq1hf6gf8vy4td2 s5luvfkvdpjv19ikpzqeev9k2 mn50c33fxflz17jv24oc68baw 1tgnabd2l6y3p1jpg8qv3hb53d"
Best regards,
Christoph
basex-talk@mailman.uni-konstanz.de