- function sqimap_session_id() {
- return( substr( session_id(), -4 ) );
+ /**
+ * imap.php
+ *
+ * Copyright (c) 1999-2001 The Squirrelmail Development Team
+ * Licensed under the GNU GPL. For full terms see the file COPYING.
+ *
+ * This implements all functions that do general imap functions.
+ *
+ * $Id$
+ */
+
+ /**
+ * Unique SessionId
+ *
+ * Sets an unique session id in order to avoid simultanous sessions crash.
+ *
+ * @return string a 4 chars unique string
+ */
+ function sqimap_session_id() {
+
+ if (session_id() == '')
+ global $RememberedSessionID;
+
+ if (! isset($RememberedSessionID))
+ $RememberedSessionID = GenerateRandomString(4, '', 7);
+ else
+ $RememberedSessionID = substr(session_id(), -4);
+
+ return( $RememberedSessionID );