Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-19-2002, 05:35 PM   PM User | #1
bcarl314
Mega-ultimate member


 
Join Date: Jun 2002
Location: Winona, MN - The land of 10,000 lakes
Posts: 1,855
Thanks: 1
Thanked 45 Times in 42 Posts
bcarl314 will become famous soon enough
session information going between .html and .php files

Just a quick question,

If I start a session in a php page and let the user add all sorts of info to it, then the user goes back to my index.html page then back to the php page, do I loose all that session data?

Thanks.
bcarl314 is offline   Reply With Quote
Old 07-19-2002, 07:35 PM   PM User | #2
Mouldy_Goat
Regular Coder

 
Join Date: Jul 2002
Location: London, UK
Posts: 126
Thanks: 0
Thanked 0 Times in 0 Posts
Mouldy_Goat is an unknown quantity at this point
Nope, shouldn't do.

The cookie should last for as long as the user has the browser open for, regardless where he/she goes.
Mouldy_Goat is offline   Reply With Quote
Old 07-20-2002, 12:49 AM   PM User | #3
bcarl314
Mega-ultimate member


 
Join Date: Jun 2002
Location: Winona, MN - The land of 10,000 lakes
Posts: 1,855
Thanks: 1
Thanked 45 Times in 42 Posts
bcarl314 will become famous soon enough
What I meant is if the user keeps their browser open and does the following:

1)goes to my home page
2)click on my php page (where I begin my shopping cart function and add items to the session)
3)goes back to my home page (.html)
4)goes back to my php page

On the return to the php page(4), (same browser session) are all the session variables that were set in the previous entry into the php page (2) available?

I'm thinking they are, but not sure.
bcarl314 is offline   Reply With Quote
Old 07-20-2002, 03:13 AM   PM User | #4
firepages
Super Moderator


 
Join Date: May 2002
Location: Perth Australia
Posts: 3,890
Thanks: 5
Thanked 79 Times in 78 Posts
firepages will become famous soon enough
session variables exist for the length of the sesion (unless specified otherwise) which basically means for as long as they are in your site, so yes - session variables set in one php page will still be available even after visitng several html pages etc (in the same site) as long as the pages which need to access the session data all have the appropriate session_register("vars") set.

In fact if the user has cookies enabled they shoud even be able to go to a few other sites, come back and still be able to use the session data, but its best not to rely on that
__________________
resistance is...

MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)
firepages is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:21 AM.


Advertisement
Log in to turn off these ads.