From: Andrea Zagli Date: Thu, 4 Mar 2021 20:13:49 +0000 (+0100) Subject: Added function ZakCgiSession::get_sid. X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=05dbeabedf10025522fed5dff753c83fc082e4a7;p=libzakcgi Added function ZakCgiSession::get_sid. --- diff --git a/src/session.c b/src/session.c index 95ddb49..a1e4af2 100644 --- a/src/session.c +++ b/src/session.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2017 Andrea Zagli + * Copyright (C) 2015-2021 Andrea Zagli * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -206,6 +206,31 @@ zak_cgi_session_get_minutes (ZakCgiSession *session) return priv->minutes; } +/** + * zak_cgi_session_get_sid: + * @session: + * + * Returns: the session's sid. + */ +const gchar +*zak_cgi_session_get_sid (ZakCgiSession *session) +{ + const gchar *ret; + + ZakCgiSessionPrivate *priv = ZAK_CGI_SESSION_GET_PRIVATE (session); + + if (priv->sid == NULL) + { + ret = NULL; + } + else + { + ret = (const gchar *)priv->sid; + } + + return ret; +} + /** * zak_cgi_session_get_header: * @session: diff --git a/src/session.h b/src/session.h index 85dca75..cf4c482 100644 --- a/src/session.h +++ b/src/session.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2016 Andrea Zagli + * Copyright (C) 2015-2021 Andrea Zagli * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -63,6 +63,8 @@ ZakCgiSession *zak_cgi_session_new (ZakCgiMain *zakcgimain, gint zak_cgi_session_get_minutes (ZakCgiSession *session); +const gchar *zak_cgi_session_get_sid (ZakCgiSession *session); + gchar *zak_cgi_session_get_header (ZakCgiSession *session); void zak_cgi_session_set_value_full (ZakCgiSession *session, const gchar *group, const gchar *name, const gchar *value);