By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,510 Members | 1,810 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,510 IT Pros & Developers. It's quick & easy.

Session_Start() Hangs after setting Session_Id

P: n/a
CjB
Hello, I am trying to do the following in one of my pages.
session_id($_GET['SESSIONID']);
session_start();

I am running php5, however as soon as I call session_start the script
hangs and nothing happens. Is anyone else experiencing this problem, or
am I doing something incorrectly?

Thanks!

Jun 30 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Syl

CjB wrote:
Hello, I am trying to do the following in one of my pages.
session_id($_GET['SESSIONID']);
session_start();

I am running php5, however as soon as I call session_start the script
hangs and nothing happens. Is anyone else experiencing this problem, or
am I doing something incorrectly?

Thanks!


session_start(); must always be listed at the top of every page.
like this :

<?php
session_start();

Jun 30 '06 #2

P: n/a

"Syl" <da**********@gmail.com> wrote in message
news:11**********************@d56g2000cwd.googlegr oups.com...

CjB wrote:
Hello, I am trying to do the following in one of my pages.
session_id($_GET['SESSIONID']);
session_start();

I am running php5, however as soon as I call session_start the script
hangs and nothing happens. Is anyone else experiencing this problem, or
am I doing something incorrectly?

Thanks!


session_start(); must always be listed at the top of every page.
like this :

<?php
session_start();


That is not necessarily true. It does NOT have to be the very first
statement in the script, but BEFORE you want to start using the $_SESSION
array.

You need to check that you have a value in $_GET['SESSIONID'] before you use
it. Try this:

if (isset($_GET['SESSIONID'])) {
session_id($_GET['SESSIONID']);
} // if
session_start();

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
Jun 30 '06 #3

P: n/a
Syl

Tony Marston wrote:
"Syl" <da**********@gmail.com> wrote in message
news:11**********************@d56g2000cwd.googlegr oups.com...

CjB wrote:
Hello, I am trying to do the following in one of my pages.
session_id($_GET['SESSIONID']);
session_start();

I am running php5, however as soon as I call session_start the script
hangs and nothing happens. Is anyone else experiencing this problem, or
am I doing something incorrectly?

Thanks!


session_start(); must always be listed at the top of every page.
like this :

<?php
session_start();


That is not necessarily true. It does NOT have to be the very first
statement in the script, but BEFORE you want to start using the $_SESSION
array.

You need to check that you have a value in $_GET['SESSIONID'] before you use
it. Try this:

if (isset($_GET['SESSIONID'])) {
session_id($_GET['SESSIONID']);
} // if
session_start();

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

Of course - you are absolutely correct Tony.

Thanks for clarifying my post.

Jun 30 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.