Reply to Re: [PHP] noob need help for sessions

Your name:

Reply:


Posted by Richard Lynch on 04/07/05 06:58

On Wed, April 6, 2005 1:59 am, p80@free.fr said:
> I'm having problem with my session, when I login my session is registered
> ok but
> when I click on another page it's canceled again.
> I use that kind of link:
> index.php?menu=voyage&sid=$sess_id
>
> then on top of the page I use:
>
>
> if(session_id()){
>
> session_id(strip_tags($_GET['sid']));
> session_start();

This only starts a session if you have session_id (above) which only
happens if you already started a session...

Perhaps you meant: if (!session_id()) above.

More likely, you don't need any of these 4 or 5 lines of code except:

session_start();

PHP manages the session ID for you just fine, for almost all uses.

> $sess_id = session_id();
> $nom_user = $_SESSION['session_nom'];
> $prenom_user = $_SESSION['session_prenom'];
> $bienvenue="Bienvenue $prenom_user $nom_user";
> }
>
> http://81.57.4.105/~pat/alliance/ (user and pass = admin) can someone
> tell me
> how when I click on the top boxes link the session is not kept? here is
> the
> code: http://hashphp.org/pastebin?pid=2354
>
> thanx in advance
>
> Pat
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Like Music?
http://l-i-e.com/artists.htm

[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

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