You are here: Re: why use $_POST when you have $_SESSION? « PHP Programming Language « IT news, forums, messages
Re: why use $_POST when you have $_SESSION?

Posted by Sandman on 01/27/07 00:04

Hi Tony,
I guess the part where I had a question was where it was absolutely
required to use session IDs. It seems like it is possible to fill a
value in $_SESSION['user'] in, say page1.php. Then you go to page2.php,
and that value is still there. So why try to remember SIDs?

I think I understand the difference between $_POST and $_SESSION,
thanks for clearing that up.

EL

On Jan 26, 2:18 am, "Tony Marston" <t...@NOSPAM.demon.co.uk> wrote:
> The session ID is simply the key to a record which exists on the server, and
> this record contains whatever session data you write to it. This means that
> different PHP pages which provide the same session ID will connect to the
> same session data on the server. This is the way that one web page passes is
> state to another web page.
>
> BTW, $_POST and $_SESSION are totally different, and it is not a case of
> using one or the other. You will always use $_POST when sending data from
> the client to the server, while the use of $_SESSION is totally optional and
> invisible to the client.
>
> --
> Tony Marstonhttp://www.tonymarston.nethttp://www.radicore.org
>
> "Sandman" <enjoylife_95...@hotmail.com> wrote in messagenews:1169805764.707449.268930@h3g2000cwc.googlegroups.com...
>
> > Is there any particular reason I should still use $_POST?
>
> > Also, I'm reading mixed things about sessions. php.net says you can
> > propagate session IDs either via cookies or session IDs:
> >http://www.php.net/manual/en/ref.session.php#session.idpassing
>
> > OK cool.
>
> > However, PHP in a nutshell makes no mention of this. Paul just says
> > hey, use session_start() and you're on your way:
>
> >http://hudzilla.org/phpwiki/index.php?title=Cookies_and_sessions
>
> > I tested it out, and it works either way.
>
> > Can someone please explain what the session ID does?
>
> > Thanks!

 

Navigation:

[Reply to this 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

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