[REST-XQ] cookies and path cookie

Thursday, 2 March 2017 · 2 messages
FE
Fabrice ETANCHAUD2 Mar 2017 13:25 #
Dear all (again ;)) As BaseX as a Web Application can serve several 'sub' applications, I ran into the following issue : 1- Logged in into the DBA interface 2- Session:close() in another rest-xq end point (in the same browser) 3- I got disconnected from the DBA interface It seems normal behavior because cookie is shared among all basex applications in the same Web Application (path cookie is the same for all sub applications). I cannot figure out how we could easily have private cookies for each 'sub-application' ? Best regards, Fabrice Etanchaud
CG
Christian Grün2 Mar 2017 13:38 #
Hi Fabrice, I experienced this as well in the past, and I believe to remember you can avoid this by using Session:delete() instead of Session:close(). If you want to ensure that no other cookie set, you could try something like...
  Session:delete('your-id'),
  let $names := Session:names()
  where empty($names)
  return Session:close()
…and report back to us if it worked out ;) Christian
Quoted text · Fabrice ETANCHAUD · 26 lines
> As BaseX as a Web Application can serve several ‘sub’ applications, > > I ran into the following issue : > > > > 1- Logged in into the DBA interface > > 2- Session:close() in another rest-xq end point (in the same browser) > > 3- I got disconnected from the DBA interface > > > > It seems normal behavior because cookie is shared among all basex > applications in the same Web Application (path cookie is the same for all > sub applications). > > I cannot figure out how we could easily have private cookies for each > ‘sub-application’ ? > > > > Best regards, > > Fabrice Etanchaud

⚡Generated with XQuery