Reply to Re: $_SESSION not working

Your name:

Reply:


Posted by flintridgeparkenfarker vonkerschnauzerheiden on 06/15/05 13:51

"Simon Stewart" <sstewart04NILSPAM@mountainviews.ie> wrote in message
news:3ha757Ffo0glU1@individual.net...
> Joe
> How is session being passed?
> You usually need to have cookies on or to pass in a href using SID.
> Simon.
>

Well, session isn't actually being passed, at least I'm not passing the id
anywhere. I have cookies on, but being new to php I don't even know what SID
is and I haven't yet explored cookies. The help files led me to believe most
of this was handled by php, but I don't know, I'm simply exploring this
entire mechanism of which I have no overview.

Thanks for any suggestions.


>
> "flintridgeparkenfarker vonkerschnauzerheiden" <no@spam.com> wrote in
> message news:11asf1fkhnt16f@corp.supernews.com...
> > On local PC, WinXP, Apache 2, PHP 5, globals off, I'm simply trying to
> > pass
> > 1 value to get sessions working.
> > On the first page (end of HTML) I do show a value in $_SESSION['item']
> > right
> > after setting it:
> >
> > FIRST PAGE:
> >
> > <a href=secondpage.php>link</a>
> >
> > </body>
> > </html>
> >
> > <?
> > if (session_start()) {
> > echo "session started...";
> > $_SESSION['item']="necklace";
> > if (isset($_SESSION['item']))
> > echo "session item is SESSION = " . $_SESSION['item'];
> > else
> > echo "session item is not set";
> > }
> > else {
> > echo "no session started";
> > }
> > ?>
> > ------------------------------------------------------------------
> >
> > BUT SHOW NO VALUE ON THE SECOND PAGE:
> >
> > <?
> > if (session_start())
> > echo "session has begun...";
> > else
> > echo "no session.";
> >
> > echo "<BR>";
> > echo "<BR>";
> > echo "going to end " . session_name() . " session; but first... <BR>";
> >
> > if (isset($_SESSION['item']))
> > echo "Session[item] = " . $_SESSION['item'];
> > else
> > echo "session item is not set";
> > ?>
> > ------------------------------------------------------------
> >
> > The output of the second page is:
> >
> > "session has begun...
> >
> > going to end PHPSESSID session; but first...
> > session item is not set
> >
> > --------------------------------------------------------
> >
> > Within the "session.save_path" are the files created by these statements
> > and
> > the value "necklace" but I'm just not able to extract that value on any
> > other pages. I've tried placing the second page in a subdirectory per an
> > earlier post, no good. It seems like it's a configuration issue, but I'm
> > unable to find anything that relates.
> >
> > I'd wager it's something simple, but it's been a couple weeks and I
can't
> > find it yet. Any help would definitely be appreciated.
> >
> > Thanks all.
> >
> > --
> > joe
> > /*------- A new survey of online daters found that
> > 47% of people believe that their online date will
> > go well... the other 53% are still missing. -------*/
> >
> >
>
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация