Page 1 of 1

$_SESSION[];

Posted: Fri Jul 26, 2002 9:10 am
by Gavski
I'm having problems with sessions.

I have a tutorial that advises me to use session_register() at the top of my page,to declare a session variable. but the variable is not held.

I have globals off in php.ini and have been advised to try $_SESSION['var'] still no persistant variable.

I use win and have set php.ini sesion.save to c:\windows\temp as instructed.

Has anyone got a simple example of setting and using a session variable so I can check that it's my setup and not my syntax?

Or any advice/help would be great

Thanks

Gav

Posted: Fri Jul 26, 2002 9:16 am
by fatalcure
here you go:

http://www.devnetwork.net/forums/viewto ... =7873#7873

That topic has a simple session script for you to test out

Posted: Fri Jul 26, 2002 9:25 am
by twigletmac
session_register() cannot be used with register_globals off. Do you have session_start() at the top of all pages that set or utilise session variables?

http://www.php.net/manual/en/ref.session.php
http://www.php.net/manual/en/function.session-start.php

Mac