You are here: Re: Authentication session variable being lost between pages « PHP Programming Language « IT news, forums, messages
Re: Authentication session variable being lost between pages

Posted by axlq on 07/30/06 15:13

In article <1154240592.518869.266370@i3g2000cwc.googlegroups.com>,
Vyoma <k.mahesh.bhat@gmail.com> wrote:
>This is quite a bit of problem I am facing, and I cannot point exactly
>where I am going wrong. I have been lurking around at several forums
>with regard to login and user authentication scripts and I have got as
>far as this:
>
>- Starting a session
>- Registering a session variable

Use of session_register() is deprecated, according to the documentation
at http://us2.php.net/manual/en/function.session-register.php

It's also a good idea to call statements similar to these before you
call session_start():

session_save_path(/usr/home/my_account/public_html/sessions");
session_name('login_ID');

....where the path is a path on your server to your directory space, and
the login ID is something that describes the cookie being set on the
visitor's browser.

><?php
>session_start();
>session_register('auth');

session_register() isn't needed, or if you want you could say
$_SESSION['auth'] = NULL;
here instead.

Later on you have this:

> $_SERVER['auth'] = 'YES';

That should be
$_SESSION['auth'] = 'YES';

and here:

>if( isset($_SERVER['auth']) && $_SERVER['auth'] == 'YES' )

Replace SERVER with SESSION.

-Alex

 

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

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