Re: Cookies Vs Sessions...?
| From: | Robert Cummings | Date: | Fri, 03 Oct 2003 15:40:50 +0000 |
| Subject: | Re: Cookies Vs Sessions...? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-164925@lists.php.net to get a copy of this message | ||
On Fri, 2003-10-03 at 11:31, Tristan.Pretty@risk.sungard.com wrote:
> Age old question...?
> Please don't flame if it is....
>
> I currently remember my visitors on my site by setting a cookie thusly:
>
> setcookie("logged", "yes");
>
> On each protected page, put an IF ($logged == "yes") { //show page etc }
> else {//show login form etc }
>
> All good, works fine hooray for me...
> BUT...
>
> I'm aware that a slight increase in a users browsers security setting, and
> this doesn't work...
> So... I've started to learn..... sessions.
>
> I have a few questions, that my texts books seem to pussy foot around, and
> I get no answer...
> 1. Can sessions work in the same way as my cookies? (Just remember a value
> to a variable, accross many page)
Yes.
> 2. can seesions be set up to work accross browser sessions? (If I close my
> browser, will they work when I open a new one?)
No, you need permanent cookies for this.
> 3. I've seen on many web sites a 'remember me' checkbox. I'd love to learn
> how to do that, is that session related? what's the step in teh right
> direction to remembering that?
Permanent cookie.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com
|
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'