Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1791
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

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
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [Web] using of an uninitialized value in expression
Next Topic: Something wrong with post_identity()?
Goto Forum:
  


Current Time: Sat May 10 23:56:10 CEST 2025

Total time taken to generate the page: 0.00865 seconds