Indeed, you have no way of knowing when the session has ended on the server 
because the session ends only when the user no longer has a session cookie 
to keep sending back from the browser (so, typically when the browser 
closes or the user manually deletes the session cookie). So yes, you 
probably want to set some kind of expiration or timeout (maybe if a 
particular session has not been active for some period of time, you can 
then close its socket).

Anthony

On Friday, June 7, 2013 3:23:02 PM UTC-4, Anthony wrote:
>>
>> If the session changes during the request, it gets pickled at the end of 
>> every request and stored in the session file (or db or cookie if using db 
>> or cookie based sessions). At the beginning of each request, the session is 
>> read from the file (or db or cookie) and unpickled. Anything that can't be 
>> pickled can't be stored in the session.
>>
>>
> Well it's not so much that I want to store something in the session 
> itself. Here is my problem specifically:
>
> We use a unix domain socket in some of our controllers to grab data via 
> rpc from another process. Currently, we have to create a new socket 
> connection for each request, but I would like to reuse the socket and have 
> one socket per one actual person making the requests (hence session). This 
> works just fine, however, I don't know when the socket is no longer 
> necessary (ie. the user logs out). At this point I think my only option is 
> to setup a timer that just closes the socket after a set timeout period, 
> because there is no callback to tell when the session is over.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to