0

I am struggerling with the Session:

When I call https://example.com/index.php/objects/index/260 I get this:

Array ( [__ci_last_regenerate] => 1614171352) 

When I call https://example.com/objects/index/120

Array ( [__ci_last_regenerate] => 1614171373)

So, two different sessions! Why do I get an additional session here?

Is this related to the htaccess file?

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA] 

Bests, yab86

yab86
  • 395
  • 6
  • 24
  • 1
    not 2 different sessions, session regenerated. You can see what is inside a session using `print_r($_SESSION)` – Vickel Feb 24 '21 at 13:07
  • Array ( [__ci_last_regenerate] => 1614171373) is the result from print_r($_SESSION). – yab86 Feb 24 '21 at 13:15
  • the session has been regenerated and the value you are getting is the UNIX timestamp. – Maroof Feb 24 '21 at 13:24
  • 1
    Solved it. Found this one: https://stackoverflow.com/questions/14472869/codeigniter-session-data-lost-after-redirect Changed ini_set('session.name', $params['cookie_name']); to ini_set('session.id', $params['cookie_name']); in session.php. Works now! :-) – yab86 Feb 24 '21 at 13:27
  • @yab86 Please close your question (or add [Solved] to the end of the title) – adampweb Feb 24 '21 at 16:13

0 Answers0