$_SESSION[];

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Gavski
Forum Newbie
Posts: 19
Joined: Thu May 16, 2002 2:30 pm
Location: UK

$_SESSION[];

Post 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
fatalcure
Forum Contributor
Posts: 141
Joined: Thu Jul 04, 2002 12:57 pm
Contact:

Post 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
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post 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
Post Reply