How do I get the unique session id for a session?
Hi, I am planning to use the session id for session as a key for a hash that I am maintaining. How do I get the session id from the session object? Thanks
On Friday 27 May 2011 19:55:39 Gurunandan Bhat wrote:
I am planning to use the session id for session as a key for a hash that I am maintaining. How do I get the session id from the session object?
Off the top of my head, engine('session')->id() should do the job. -- David Precious ("bigpresh") http://www.preshweb.co.uk/ "Programming is like sex. One mistake and you have to support it for the rest of your life". (Michael Sinz)
On 27/05/2011 23:56, David Precious wrote:
On Friday 27 May 2011 19:55:39 Gurunandan Bhat wrote:
I am planning to use the session id for session as a key for a hash that I am maintaining. How do I get the session id from the session object?
Off the top of my head, engine('session')->id() should do the job.
Or even session->id; -- Alexis Sukrieh
Thanks David and Alexis. It would be great if this could be included in the Session::X docs. Sometimes you often need to store objects that cannot be serialized (like sockets) in your own hash indexed by the session id. Thanks once again On Sat, May 28, 2011 at 2:27 AM, Alexis Sukrieh <sukria@sukria.net> wrote:
On 27/05/2011 23:56, David Precious wrote:
On Friday 27 May 2011 19:55:39 Gurunandan Bhat wrote:
I am planning to use the session id for session as a key for a hash that I am maintaining. How do I get the session id from the session object?
Off the top of my head, engine('session')->id() should do the job.
Or even session->id;
-- Alexis Sukrieh
_______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
On Saturday 28 May 2011 13:09:45 Gurunandan Bhat wrote:
Off the top of my head, engine('session')->id() should do the job.
Or even session->id;
Thanks David and Alexis.
It would be great if this could be included in the Session::X docs. Sometimes you often need to store objects that cannot be serialized (like sockets) in your own hash indexed by the session id.
Agreed. Just tweaked the documentation for the session() keyword to illustrate using session->id, thanks for the suggestion. Cheers Dave P -- David Precious ("bigpresh") http://www.preshweb.co.uk/ "Programming is like sex. One mistake and you have to support it for the rest of your life". (Michael Sinz)
On Saturday 28 May 2011 10:27:07 Alexis Sukrieh wrote:
Off the top of my head, engine('session')->id() should do the job.
Or even session->id;
Ah yes, that's rather more succinct :) I forgot session()'s ctrickery to either set / return session vars or call session engine methods depending on how you use it. -- David Precious ("bigpresh") http://www.preshweb.co.uk/ "Programming is like sex. One mistake and you have to support it for the rest of your life". (Michael Sinz)
participants (3)
-
Alexis Sukrieh -
David Precious -
Gurunandan Bhat