473,796 Members | 2,570 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session variable VS HREF parameters...

I already use session variable in my project to set a session timeout when
the user doesn't do anything for 10 minutes.

When I call other pages, I often use parameters in HREF link.

I was wondering if it was better to pass parameter from page to page as
session variable instead of doing it in HREF link?

Thx for the hint !
Nov 18 '05 #1
2 2500
The first part of your message is very confusing to me, as Sessions time out
all by themselves. However, I can help you with your other question.
When I call other pages, I often use parameters in HREF link.

I was wondering if it was better to pass parameter from page to page as
session variable instead of doing it in HREF link?
You have a couple of issues here. When you pass data via URL, you are
exposing it to the user, which can be a security risk, so one consideration
is how sensitive the data is. If it's not sensitive, you're fine, as long as
you make sure that the user can't create a parameterized URL that would
cause some problem. One of the advantages of using QueryString parameters is
that the user can bookmark a dynamic page, as the bookmark will have the
parameters in it.

As for Sessions, they can be problematic as well, since they time out after
a certain interval of inactivity. As long as you make sure to handle this
eventuality, Session is fine.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"+The_Taco+ " <do***********@ dessausoprin.co m> wrote in message
news:eZ******** *****@TK2MSFTNG P12.phx.gbl... I already use session variable in my project to set a session timeout when
the user doesn't do anything for 10 minutes.

When I call other pages, I often use parameters in HREF link.

I was wondering if it was better to pass parameter from page to page as
session variable instead of doing it in HREF link?

Thx for the hint !

Nov 18 '05 #2
I think he means that he is using session as a crewd way to timeout a user
by setting session.timeout = 10 and checking for it on each postback.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Kevin Spencer" <ke***@takempis .com> wrote in message
news:%2******** **********@TK2M SFTNGP10.phx.gb l...
The first part of your message is very confusing to me, as Sessions time out all by themselves. However, I can help you with your other question.
When I call other pages, I often use parameters in HREF link.

I was wondering if it was better to pass parameter from page to page as
session variable instead of doing it in HREF link?
You have a couple of issues here. When you pass data via URL, you are
exposing it to the user, which can be a security risk, so one

consideration is how sensitive the data is. If it's not sensitive, you're fine, as long as you make sure that the user can't create a parameterized URL that would
cause some problem. One of the advantages of using QueryString parameters is that the user can bookmark a dynamic page, as the bookmark will have the
parameters in it.

As for Sessions, they can be problematic as well, since they time out after a certain interval of inactivity. As long as you make sure to handle this
eventuality, Session is fine.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"+The_Taco+ " <do***********@ dessausoprin.co m> wrote in message
news:eZ******** *****@TK2MSFTNG P12.phx.gbl...
I already use session variable in my project to set a session timeout when the user doesn't do anything for 10 minutes.

When I call other pages, I often use parameters in HREF link.

I was wondering if it was better to pass parameter from page to page as
session variable instead of doing it in HREF link?

Thx for the hint !


Nov 18 '05 #3

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

Similar topics

0
4024
by: Darrell Blake | last post by:
I'm trying to use sessions to allow people to log into my site. The problem is that sometimes it works and sometimes it doesn't! As far as I'm aware my script is fine (hence why it works sometimes) and I've had people tell me it's fine too. Basically, when a user enters their username and password it checks that against my mysql database and if correct creates a session and stores their username in it in a variable called uname. Then, when...
1
7790
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains: ---------------------------------------------------------------------------- <?php ini_set("session.use_cookies", "off"); ini_set("session.use_trans_sid", "on"); session_start(); $_SESSION = ""; $_SESSION = ""; echo "<form method='POST' action='login.php'>
5
2021
by: Martien van Wanrooij | last post by:
Some time ago I already posted a question about a site that consists of several pages where the visitor, on every page can answer one or two questions in order to fill out an intake for for an investment advice. So in the page question1.php = a form "action = question2.php" and in question2.php the variables (results of the form) are registered to the session. What I still didn't succeed to is the following: let us say the customer is...
2
3310
by: Damien | last post by:
Hi to all, I'm currently re-designing our intranet : nice and lean CSS2, cleaned-up PHP 4.3.7, better-normalized MySQL ;o). So I've started using the $_SESSION variable instead of register_globals and a couple "better pratice" code. Not perfect, but better. Problem : I'm testing everything with Firefox on my machine (IIS on WinXP Pro), and everything is ok. As soon as I try MS IE 6, it doesn't seem to keep the sessions from page to...
3
3518
by: Lee Moore | last post by:
I have some user controls defined that represent a common header and footer for a particular site. the footer contains links with querystring parameters based on session variables. The problem is, I cannot access the session variables within my user control. The user controls work perfectly otherwise. Example code included.
1
393
by: helloroger | last post by:
Hi folks I'm new to php an currently trying to insall my first php-Session. I've written the following code which uses the 2 variables cat and langua, but somehow they are not correctly registered in the session. When pressing the links to set the 2 session variables, they don't move at all. There values are always 1 and 9. Does anybody have an idea how I can set the value of a session variable using a <a href ...>?
14
2382
by: aroraamit81 | last post by:
Hi, I am facing a trouble. I have some Session variables in my code and somehow my session variables are getting mixed up with other users. For example User A has access to 10 companies and User B has access to 5, now when both of us hits to the server at the same time then their session variables gets mixedup means either User A and USer B will have now 5 companies or both have 10 companies. Now again when User A hits to the server...
6
8358
by: Vyoma | last post by:
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 - Using the variable to check if the user is authenticated or not. - Authenticating the user through MySQL database - Logging of the user, by setting the...
10
313
by: sheldonlg | last post by:
Something weird is happening here. I inherited some code that looks like what is shown below. The problem is that when menu1.php is included, the session variables are not known in homepage.php. If I comment out the include of menu1.php, then homepage.php sees the session variables. I have done this with and without session_start() in menu1.php. I can't see why it would lose the session variables. tmpl.php: ========= <?php include...
0
9684
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
9530
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
10236
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
7552
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
6793
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5445
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5577
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
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.