PHP Session not getting started but using other session -


i have code in have used session_start() not working. using php.

scenario below :

as in php need put session_start() in each file if want access session. have created common file being included on each php page.in common file first line session_start() & have included file in each other php file first line.

so when run code session not getting started. it's redirecting same page session not set & not getting values inside session because it's not created.

what did, testing created test project. in taken 2 files index.php & index1.php. started session in index.php & used in index1.php. it's running properly. because of code taking session file of test project.

so whenever need run code, running test project first (so session created it) & running code. working fine.

but alone it's not starting session & other session related checks failing & redirecting same page again & again.

why happening ? whats reason behind ? have faced same issue ?

if yes, appreciated.

first, ensure have put session_start() after launch page, should below first <?php in document. should appear once in every page going need session cookie.

also, ensure have created session variables , defined them $_session['id'] before calling them.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -