473,608 Members | 2,410 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Quick Session Question

I read and reread the PHP manual about sessions, and I have a quick
question. What causes the session id to change? I tried destroying the
session and unsetting the session vars, but it maintains the same id.

Just so you know, I don't need to make the session id change for any
reason. I'd just like to know what to avoid since I'm going to be storing
data the user enters with their sessionid and I'd like to make sure that
they can still access it through their entire visit.
Jul 16 '05 #1
2 3257
Jason Telisch wrote:
I read and reread the PHP manual about sessions, and I have a quick
question. What causes the session id to change? I tried destroying the
session and unsetting the session vars, but it maintains the same id.

Just so you know, I don't need to make the session id change for any
reason. I'd just like to know what to avoid since I'm going to be storing
data the user enters with their sessionid and I'd like to make sure that
they can still access it through their entire visit.


The session id shouldn't change. It's randomly generated when the user
enters your website and is then passed back by the browser using cookies
or as part of the url on each subsequent request. This id is then used
as the key to the session variables.

Destroying the session variables simply destroys the contents of the
session. The id and the empty session will continue to exist.

Jul 16 '05 #2
Kevin Thorpe wrote:
Jason Telisch wrote:
I read and reread the PHP manual about sessions, and I have a quick
question. What causes the session id to change? I tried destroying
the session and unsetting the session vars, but it maintains the same id.

Just so you know, I don't need to make the session id change for any
reason. I'd just like to know what to avoid since I'm going to be
storing data the user enters with their sessionid and I'd like to make
sure that they can still access it through their entire visit.

The session id shouldn't change. It's randomly generated when the user
enters your website and is then passed back by the browser using cookies
or as part of the url on each subsequent request. This id is then used
as the key to the session variables.

Destroying the session variables simply destroys the contents of the
session. The id and the empty session will continue to exist.


So, when the client deletes the cookie, the session id will be lost. If
the client continues to visit the site, he will receive a new cookie
with a new session id.

Jul 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1925
by: Reply-Via-Newsgroup Thanks | last post by:
Folks, I consider myself a reasonably strong PHP programmer, but I've not used sessions before (I've used cookies instead) and I'd appreciate it if someone could confirm something for me. Namely... I'm working on someone else's code who has used sessions - In their main login page, they do not use session_start() but instead, just write directly to the $_SESSION super global array variable. This seems to work - however on some later...
1
1526
by: YT | last post by:
Couple of quick ASP (3.0) Cookie questions: 1/ I'm using a cookie in my asp script to place cookies (within a key) so my code looks like: Response.Cookies( "quoteform" )( "name" ) = Session( "name" ) Response.Cookies( "quoteform" )( "organization" ) = Session( "organization" ) Response.Cookies( "quoteform" )( "address1" ) = Session( "address" ) Response.Cookies( "quoteform" )( "address2" ) = Session( "suite" ) Response.Cookies(...
3
3314
by: Greg Scharlemann | last post by:
Does the redirect statement: header(Location:"http://www.newpage.com"); need to come before certain statements? I've setup a login page and try to redirect a user once they have logged in (after I set the appropriate $_SESSION value) but I get the following error: Warning: Cannot modify header information - headers already sent by (...)
10
3497
by: tshad | last post by:
I have been using the default session state (InProc) and have found that I have been loosing my information after a period of time (normally 20 minutes). Is there anyway to find out how much more time I have on a session? If I do a refresh, does reset the session clock? Do you have have to go to another page to reset the session timeout or will a postback also do it? This is important as we have a few pages that a user
8
5485
by: KMZ_state | last post by:
We have a question here where a developer says that if the same user starts 2 instances of the application on his machine, the session variables may get mixed up b/c the session is PER IP ADDRESS. I thought each browser instance had its own session and the two instances of the application would never get mixed up? Thanks.
6
1496
by: encoad | last post by:
Hi everyone, I'm new to C# and I am building website which allows users to fill out various forms. All is going well, however I'm having a bit of trouble with one particular issue. The main page enables users to enter information, and connect to other pages where they can enter additional details. After entering those additional details on the other pages, they are redirected back to the main page. I know I could use Session...
4
2159
by: PokerMan | last post by:
Hi In a session key add such as: Session.Add("CustId", userId); if i then called that again so say i did this
2
1454
by: DLN | last post by:
Hello all, I apologize for the naivety of this question, but I'm wondering whether session variables can ever be modified (somehow) by a client without having to go through code that I write. If I read in user input from a web form, sanitize the input to make sure there isn't any injected data, and then store the sanitized input in a session variable, is there any way for that session variable to be modified by the client afterwards? I...
0
8067
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8010
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8501
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8483
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8157
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8349
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6015
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4030
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1336
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.