You are here: Re: Session destroy help « All PHP « IT news, forums, messages
Re: Session destroy help

Posted by J.O. Aho on 03/04/07 22:57

rsvore wrote:

> Currently the destroy is at the end of the script but if I'm on step one of
> the form and go to step two and decide to go back to step 1 by using the
> back button in IE it destroys session the step1 values and I have to
> repopulate the fields. I have an include that pulls the DB population script
> so I will try the destroy there.

I would put in an extra page in the beginning, as you have it now, I guess, is:

page with link to form

first form page

second form page

...

yes or no page

kill session page


This has the funny thing that you recreate a session if you use the backwards
buttons and I guess thats what makes your session to be recreated. Do this
instead:

page with link to form

page creates session and then forward to next page with header()

first form page

second form page

...

yes or no page

kill session page


When you back from "first form page" you will come to "page with link to form"
without a new session is created. No new session is created when you go from
"second form page" to "first form page" as the session isn't created on that page.

Of course you can keep things like it is, but you have to check if there is a
session or not when you load "first form page", if none detected create a new
session, if session detected don't do anything.

I hope you did follow this quite late evening post.

--

//Aho

 

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

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