473,800 Members | 2,613 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Storing sessions

15 New Member
Can anyone tell me what is the best way to store sessions into database in order to recognize that user next time he access the site?I thought about IP address but then I remembered that it is different every time.What thing regarding a user is always the same?
Nov 5 '07 #1
6 1148
MarkoKlacar
296 Recognized Expert Contributor
Hi,

the best practice for this is to store a username and a password.
When a user logs in, you can start a session based upon his username.
Start with this.

Let me know if you need some more information.

Cheers
Nov 5 '07 #2
pedjasmek
15 New Member
I came up with the same idea but I want to know something else.Assume that certain user wants to remain logged in that means that he doesn't need to fill in username and password fields again.How can I know that it's him again?
Nov 5 '07 #3
ak1dnar
1,584 Recognized Expert Top Contributor
First, why you need to track the user visits? as an example, do you want to store some customized style settings for individual users?
You can get the IP address of the user, but how do you plan to filter the users with shared IPs.
Nov 5 '07 #4
pedjasmek
15 New Member
I could make some kind of voting system allowing users to vote only once in,say,24 hours or similar.This is just one example.Now you see why I've posted the question
Nov 5 '07 #5
ak1dnar
1,584 Recognized Expert Top Contributor
There are lots of sample scripts you can find by googling. Thanks.
Nov 5 '07 #6
Atli
5,058 Recognized Expert Expert
Hi.

Have you considered using Cookies?
Nov 5 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1772
by: Francisco | last post by:
I have this problem: I have a database with information about games, and users are able to vote for them. Everytime a user votes for a game I store the unique game name into a session variable (an array). So if they are in a page were they already voted, they won't have the option to do so. The idea is that the session cookie lasts "forever", I don't want them voting for the same game everytime they get to the site. This isn't soo strict,...
3
11768
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a table in MySQL with the path & filename to the image. I have successfully uploaded and performed an update query on the database, but the problem I have is I cannot retain the primary key field in a variable which is then used in a SQL update...
6
2256
by: Rob Meade | last post by:
Hi all, At work we have 2 servers in a cluster for our web apps. One problem we have experienced (along with many others!) - is that if a user is logged into one of the applications on server a for example and it goes offline or fails their session is lost also - even though the application becomes available on server b. I have heard that it is possible to either exchange the sessions between
14
2606
by: mjkahn | last post by:
I've read (and read!) that you shouldn't store objects in Session variables. I've read these reasons: - The object takes up memory that may not be freed until the session times out. Better to create the object only when you actually use it. - Causes poor performance because the thread that created the object has to service all requests for it. Assuming I can live with the memory and performance implications (a big if,
4
1050
by: Jerry J | last post by:
I have a web application that has a menu item that allows the client to chose a style (changes the color scheme). What are my options for storing that information so the next time the client hits the site the style previously chosen is used again? Should I use the cookie? Jerry J
7
1548
by: py | last post by:
how feasible is it to cache an entire page's content in a session variable? i am already doing it and it works fine, except i am afraid of scalability issues. what is the best way to test this? and is there an obvious reason why i should not do this.
1
949
by: andchoi | last post by:
I am wondering whether this is the best way to do this. Would love to hear what people think. Here is the scenario: I have this ASP.NET 2.0 page which allows user to enter some parameters and then it dynamically generates a WAV or WMV file, depending on preference. I want to send this back to the user via an <OBJECT> tag. The way I am doing this right now is to assign the byte array to the Session. Then, I generate an <OBJECT> tag...
2
23807
by: Anthony Smith | last post by:
I have read the message boards in this group and others. I still have not been able to pull my obect out of a session and use it. Here is how I store it in a session: <? //Include the UserClass & RoleClass so that we can create a user object. require_once("UserClass.php"); require_once("RoleClass.php");
1
1386
by: FrEaKmAn | last post by:
Hi I found this article, I hope you're ok with posting links to other sites http://shiflett.org/articles/storing-sessions-in-a-database basically it's nice way to store sessions in a database and I'm wondering if I can do something like this. If we use login page and if login is successful, that we only assign and insert for example login variable equal to 1 and maybe also user id, for example 10, so that then I could use the script to...
0
9691
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
9551
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
10279
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...
0
9092
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7582
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
5473
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
5607
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4150
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.