im a bit confused with sessions though
should i put start_session(); on every page including my index.php page which is my homepage.
i have these files before a user logs in
forgot password
register
home
when a user logs in they have access to
poll
change password
guestbook
do i have to put include session_start; on every page its just ive included it on guestbook and it comes up with this error
A session had already been started - ignoring session_start() and the same message on the change password page.
im not using sessions on the guest book page or the change password page is that why? Its just i though you had to include start_session() on every page you view once logged in? is this correct or am i doing something wrong
please can someone advise me what to do and which pages should include sessions?
sessions
Moderator: General Moderators
You only need to use session_start on pages when you need access to session variable.
for example, you could start a session, then go to another page that doesn't need the session variable, then on another page, restart the session and have access to the session variable from the first page.
As for the error message, are you including any files that you may have put session_start in?
Mark
for example, you could start a session, then go to another page that doesn't need the session variable, then on another page, restart the session and have access to the session variable from the first page.
As for the error message, are you including any files that you may have put session_start in?
Mark
Thanks i think i understand now
it seems to work fine now
ive taken out the start_session in guestbook and change password as im not using session variables on those pages.
cheers.
quick question.
on my site a registers then gets sent to the homepage where then can leave comments in the guest book. i obviously don't want to have them fill in another username and and email address as will already have that.
so in the form would i just call up their information using session variables, could you give me a little examle as to how to do that please?
it seems to work fine now
ive taken out the start_session in guestbook and change password as im not using session variables on those pages.
cheers.
quick question.
on my site a registers then gets sent to the homepage where then can leave comments in the guest book. i obviously don't want to have them fill in another username and and email address as will already have that.
so in the form would i just call up their information using session variables, could you give me a little examle as to how to do that please?
read this tutorial.
Not exactly what you need, but if you read it, you will understand more and be able to figure it out for yourself - viewtopic.php?t=6521
Mark
Not exactly what you need, but if you read it, you will understand more and be able to figure it out for yourself - viewtopic.php?t=6521
Mark
-
magicrobotmonkey
- Forum Regular
- Posts: 888
- Joined: Sun Mar 21, 2004 1:09 pm
- Location: Cambridge, MA