Session created by one project is also accessible by other project in PHP -


in 1 of project on localhost session created user login. stored in $_session['uname']. other project using same session name variable. problem when have logged first project admin area , go other project admin area, doesn't ask me enter credentials login window; instead directly takes me admin panel. know happening due use of same $_session['uname'] in various projects. wondering how can force other project display log in window although have logged first project?

it might possible other project has different login credentials never offer me login screen if have logged first project.

i thinking how professional websites keep session name unique other can never use it? in case session name accessible everywhere.

looks using localhost every projects in local.

  1. create separate virtualhost each project, session unique each project - cookie's domains different.
  2. if want keep localhost (i'd not recommend), should think namespace session of each project, $_session['project1']['uname']

Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -