Session ID and Session Variable

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Session ID and Session Variable

Postby proware » Wed Aug 11, 2010 10:42 am

What do I need to do to get a unique server side session ID for a smart client session?

This needs to be different for each client instance.

I would rather use a server generated unique ID rather than using a random number generator and storing this to a variable.

Cheers
David Younger
TSM
proware
 
Posts: 18
Joined: Wed Oct 01, 2008 5:54 am

Re: Session ID and Session Variable

Postby jcompagner » Wed Aug 11, 2010 11:18 am

security.getClientID() is a unique serverside id.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8828
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Session ID and Session Variable

Postby proware » Thu Aug 12, 2010 1:54 am

Thank you ;-]
proware
 
Posts: 18
Joined: Wed Oct 01, 2008 5:54 am

Re: Session ID and Session Variable

Postby vlad_chiru » Mon Aug 22, 2022 9:29 am

jcompagner wrote:security.getClientID() is a unique serverside id.

I know about this, but it's not in sync with the browser session. If the user closes the window and opens it again, it will be a different ID. I cannot store a auth session with it.
vlad_chiru
 
Posts: 3
Joined: Mon Jul 01, 2013 11:47 am

Re: Session ID and Session Variable

Postby jcompagner » Thu Aug 25, 2022 9:59 am

we don't have a stable id for something like that, that is mostly a username that you need to provide to the system, what you can do is create a uuid string
and after login do a setUserProperty() this stores it on the clients browser and as long as the client doesn't flush all the local storage the next time you can ask for that uuid with getUserProperty()
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8828
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 7 guests