aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorVirtualTam <virtualtam@flibidi.net>2015-09-06 16:16:53 +0200
committerVirtualTam <virtualtam@flibidi.net>2015-09-06 16:16:53 +0200
commitf5d6b19b73cd026cb1d937aab16d48b43e412c77 (patch)
tree8c100e6ca4cba5870640cf3e0ec688b1f0fa7474 /index.php
parenta02257b8aed58ef2f8536c877ce2fb222f84ac40 (diff)
parent68bc21353a6138a898724c8bb87684bb2b6b2c1c (diff)
downloadShaarli-f5d6b19b73cd026cb1d937aab16d48b43e412c77.tar.gz
Shaarli-f5d6b19b73cd026cb1d937aab16d48b43e412c77.tar.zst
Shaarli-f5d6b19b73cd026cb1d937aab16d48b43e412c77.zip
Merge pull request #338 from virtualtam/fix/unique-uniqid
Session ID: extend the regex to match possible hash representations
Diffstat (limited to 'index.php')
-rwxr-xr-xindex.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/index.php b/index.php
index d615da1f..8863cc29 100755
--- a/index.php
+++ b/index.php
@@ -92,16 +92,18 @@ ini_set('session.use_only_cookies', 1);
92// Prevent PHP form using sessionID in URL if cookies are disabled. 92// Prevent PHP form using sessionID in URL if cookies are disabled.
93ini_set('session.use_trans_sid', false); 93ini_set('session.use_trans_sid', false);
94 94
95// Regenerate session id if invalid or not defined in cookie.
96if (isset($_COOKIE['shaarli']) && !is_session_id_valid($_COOKIE['shaarli'])) {
97 $_COOKIE['shaarli'] = uniqid();
98}
99session_name('shaarli'); 95session_name('shaarli');
100// Start session if needed (Some server auto-start sessions). 96// Start session if needed (Some server auto-start sessions).
101if (session_id() == '') { 97if (session_id() == '') {
102 session_start(); 98 session_start();
103} 99}
104 100
101// Regenerate session ID if invalid or not defined in cookie.
102if (isset($_COOKIE['shaarli']) && !is_session_id_valid($_COOKIE['shaarli'])) {
103 session_regenerate_id(true);
104 $_COOKIE['shaarli'] = session_id();
105}
106
105include "inc/rain.tpl.class.php"; //include Rain TPL 107include "inc/rain.tpl.class.php"; //include Rain TPL
106raintpl::$tpl_dir = $GLOBALS['config']['RAINTPL_TPL']; // template directory 108raintpl::$tpl_dir = $GLOBALS['config']['RAINTPL_TPL']; // template directory
107raintpl::$cache_dir = $GLOBALS['config']['RAINTPL_TMP']; // cache directory 109raintpl::$cache_dir = $GLOBALS['config']['RAINTPL_TMP']; // cache directory