Home » U++ Library support » U++ MT-multithreading and servers » A few questions about Skylark sessions
Re: A few questions about Skylark sessions [message #38654 is a reply to message #38634] |
Tue, 01 January 2013 15:16   |
|
Peter wrote on Mon, 31 December 2012 12:33 | What if I call NewSessionId() and want to read the new value of session id in the same request? Since the old value is preserved in the shared variable space until next request, I can't access the new one by http["@__skylark_session_cookie__"].
|
First of all, @__skylark_session_cookie__ is not something really related to this. The '@' prefix means it is variable read from cookie, in this case it is the session cookie. So no matter what you do with the session id, it is logical that @__skylark_session_cookie__ still has the same value, because it shows what came from the cookie. The preservation of variables in shared space as writen about in docs actually concerns only the '.' prefixed session variables. There is no other way to read the session id and the fact that you can read it this way is more or less just a coincidence.
In your code you should never need to know the session id, it is just a behind the scenes mechanism. If you need to identify the user or something, just use a session variable or separate cookie (using SetCookie() method). It will give you better control without interfering with the Http internals.
Honza
|
|
|
Goto Forum:
Current Time: Sat May 10 21:18:47 CEST 2025
Total time taken to generate the page: 0.03089 seconds
|