PHP Session Storage and header("location:") Issue -


i'm having trouble session , header. first of all, both working on local development computer. after published website, don't work there.

the first problem storing session data. tried everything.

  • i wrote session_start() @ top of page.
  • checked if folder writable is_writable(session_save_path()) method. returns true.

but still not working.

second header("location: "). works on localhost not working on server published website.

what missing?

for example, @ index.php, lines don't work.

<?php session_start(); if (empty($_session['counter'])) {     $_session['counter'] = 0; } echo $_session['counter'] ++; ?> 

when refresh page, doesn't increment value.

solved!

it seems white spaces before session_start() causing problem. removed them , works.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -