Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Php, after change session.name, session ID will be changed everytime I load

Tags:

php

session

I have a strange error regarding the session name and session id.

I have used ini_set() to change session.name from PHPSESSID to 'AAA'

Also ini_set() is set before session_start()

Tired to use session_name() instead, same result

After I do that, the session_id() will return different id whenever I load the page. After I change back, work fine again.

May I have help to solve this?

Thank you very much!!

Update Solution:

Cannot change php session cookie name

like image 411
Micah Avatar asked Nov 11 '22 18:11

Micah


1 Answers

Have you tried $mySession = session_name("AAA"); where $mySession is the current session?

like image 99
ahmadsc Avatar answered Dec 06 '22 05:12

ahmadsc