0

I am having a problem where my session variable is not being set (Session variables only sets once the page has been refreshed) and I think the reason is that the page is loading before the PHP code has finished running. Resulting in the question: Can session variables be set/created after the page has loaded?

Community
  • 1
  • 1
Alex Wetton
  • 199
  • 1
  • 1
  • 10
  • Do you have `session_start();` in the top of your document? Forgetting about session_start is surely the most common mistake in this topic. Show us some code... it's impossible to know what's going on unless you give us more info. – faerin Jan 22 '15 at 19:39
  • session_start() will fix it – Dimitri Jan 22 '15 at 19:39
  • yep I have session start, please read the comments on the post linked as I have not attained an answer/solution yet. – Alex Wetton Jan 22 '15 at 19:40

1 Answers1

1

The answer to the question is a resounding

YES

AbraCadaver
  • 78,200
  • 7
  • 66
  • 87