473,474 Members | 1,822 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

session_set_cookie_params() question

I am trying to get a proper implementation logging a user in using a DB
backend.

This is how I have it set up so far. session_start() is called when
someone logs on to the site. It checks to see if there is a session
variable called uid (user id). If there is, it verifies that it is
still valid otherwise it will unset it. Now when a user tries to login
the script destroys the old session (including the cookie, which expires
when the browser closes). After it has verified the user it then calls
session_set_cookie_params(60 * 60 * 24 * 14) then session_start() again
and sets the uid field for $_SESSION.

When the user gets the successful login page the cookie is set
correctly. I can verify this through Firefox. But when the user goes
to another page on the site, the cookie is reset to expiring when the
browser closes.

Is this an issue with sessions or am I not implementing this right? I
am running PHP 5.1.2 on Gentoo Linux.

Also, how efficient are PHP sessions? Am I better off using a DB for
sessions and writing my own handling?
-- Kyle
Mar 21 '06 #1
0 1239

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

Similar topics

3
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
7
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask...
3
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
10
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server...
53
by: Jeff | last post by:
In the function below, can size ever be 0 (zero)? char *clc_strdup(const char * CLC_RESTRICT s) { size_t size; char *p; clc_assert_not_null(clc_strdup, s); size = strlen(s) + 1;
0
by: Kyle Teague | last post by:
I am trying to get a proper implementation logging a user in using a DB backend. This is how I have it set up so far. session_start() is called when someone logs on to the site. It checks to...
3
by: elyob | last post by:
I want to test locally and can't get past my cookie protection, is this right? It doesn't seem to work ... if ($_SERVER=="127.0.0.1") { session_set_cookie_params(7200, '/', '.localhost'); }...
56
by: spibou | last post by:
In the statement "a *= expression" is expression assumed to be parenthesized ? For example if I write "a *= b+c" is this the same as "a = a * (b+c)" or "a = a * b+c" ?
3
by: turnitup | last post by:
I seem to be able to get these to work separately, but not together. So if I do session_save_path("/blah/blah/") it saves my sessions to that path. but if I follow it by...
0
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,...
0
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...
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...
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: 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 ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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...

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.