473,473 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How can i serialize session in php

5 New Member
Hello. I'm beginner in php framework . I have a problem. I have 3 page. 1 login.php , 2 user_view.php , 3 admin.php. I want to serialize the session login and password , and i want to controll it in user_vire.php and admin.php . Please help
Jul 7 '10 #1
4 1560
Dormilich
8,658 Recognized Expert Moderator Expert
er, why would you need to serialize primitive values like the login or password string? such values (i.e. non-objects, non-resources, etc.) can be saved directly in the session.
Jul 7 '10 #2
Eni Shima
5 New Member
@Dormilich
OK thanks but i want use serialize function with base64_encode to save the session username and password . How can i controll this value in user_view.php and admin.php . Please help me with an example
Jul 7 '10 #3
TheServant
1,168 Recognized Expert Top Contributor
I too don't understand what's wrong with just using a $_SESSION? When you say control this value in user_view.php and admin.php, what do you mean? What are you doing with the variables?

Generally how login's work is once a user logs in, for example, the username (or some idetifier) is stored in the $_SESSION. That is then used to collect other account information from a database which has all the rest of the info. Taking a stab in the dark, I am going to guess you don't want to use a database, which will require lots of file reading and writing, and will take up more resources than just using a database in most cases.
Jul 8 '10 #4
Markus
6,050 Recognized Expert Expert
Just to hit it home: scalar values DO NOT NEED TO BE SERIALIZED. If you do not understand why, then read up on serialization.

Oh, and PHP isn't a framework.
Jul 8 '10 #5

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

Similar topics

5
by: Just D. | last post by:
Do we have any access to the Session object from a different Session? The idea is to save Session of a current user and then if he logs in again then return the Session back. It's not a problem to...
2
by: jakk | last post by:
Below is the exception that Iam getting. It says that the DataView that Iam storing in the session is not Serializable. BUt works fine if I store in the inproc session and fails if I switch to...
5
by: sdettmers | last post by:
Hi, Database: SQL Server Session: SQL Server Language: C# Application: ASP.Net I have created a login page which attempts to retrieve the users record from the database and I...
2
by: Brian Cryer | last post by:
I'm curious (as opposed to having a definite need), but given that I know how to serialize session information, does anyone know how in the .NET 1.1 framework I could write my own SessionProvider,...
2
by: Dave | last post by:
We just started getting this error message in our application today (stack trace below). From the OutOfMemoryException, I'm guessing it could be a memory leak. I'm making sure I'm closing all my...
2
by: Dave | last post by:
I have an application running on a 3 server webfarm running Windows 2003 with SQLServer Session state. After running for several hours, I started getting the following error. When I access each...
1
by: js | last post by:
Does anybody knows how to solve the problem? I added attribute to the following classes in Microsoft.Practices.EnterpriseLibrary.Data namespace, but I still get the error. Thanks. ...
1
by: Tim | last post by:
Could anyone tell me what this means and how do I correct it. Any suggestions? Thanks! Tim Richardson IT Developer and Consultant www.paladin3d.com Unable to serialize the session state. In...
4
by: NAT | last post by:
I was using session mode as "InProc"(entered in web.config). I have deployed my ASP.NET appln. on a server which uses Load Balancer. i.e I have two servers. I am using session across pages.The...
0
by: André | last post by:
Hello, I'm using 2005 c# .net and SQL server 2000. I want to store my session state in sql server. I am getting this error when I try to add a 'System.Web.UI.WebControls.Table' Unable to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
1
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...
0
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,...
1
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.