473,322 Members | 1,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Logout problem using cookie

Hi All,I'm using following two codes for logging in and logging out,respectively.
At the localhost the codeis working fine however when uploaded on the internet,The login page works fine but the logout page has no effect.Clicking on logout tab does not logs out the user and the user account remains intact.
Any help please.


Login:

[PHP]<?
setcookie("appid",$row->applicantid);
setcookie("email",$row->email);

?>[/PHP]

Logout:

[PHP]<?
setcookie("appid","");
setcookie("email","");
?>[/PHP]


with regards
Technoatif
Jul 24 '08 #1
3 2004
pbmods
5,821 Expert 4TB
Heya, Techno.

Consider storing those values in the session rather than cookies. It will make your code more reliable, and it will prevent hackers from tinkering with the values (to log on as somebody else, for example).
Jul 24 '08 #2
thanx for the reply.
Can you please give some example
Jul 25 '08 #3
pbmods
5,821 Expert 4TB
On your login page:
Expand|Select|Wrap|Line Numbers
  1. session_start();
  2. $_SESSION['appid'] = $row->applicantid;
  3. $_SESSION['email'] = $row->email;
  4.  
On your logout page:
Expand|Select|Wrap|Line Numbers
  1. session_start();
  2. unset($_SESSION['appid']);
  3. unset($_SESSION['email']);
  4.  
http://php.net/session
Jul 25 '08 #4

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

Similar topics

3
by: Phil Powell | last post by:
class LoginSessionGenerator extends MethodGenerator { function LoginSessionGenerator() {} /** * Logout * * @access public */ function &logout() { // STATIC VOID METHOD
0
by: Phil Powell | last post by:
<?php class LoginSessionGenerator { /** * Logout * * @access public */ function &logout() { // STATIC VOID METHOD
0
by: konsu | last post by:
hello, i need to implement a secure web site in php and mysql but i have just started looking at php a few days ago, and i would appreciate any advice from the experts. the site, as i said,...
5
by: vincent | last post by:
Hi, If i login to the site again (may be in the same pc or different pc), system must allow me in and end my previous session. How do i go about doing this? This is to ensure that an user...
0
by: Kuldeep | last post by:
I'm using domain wide authentication cookie for single-signon solution. Single signon is working fine but logout doesnt work. I tried using Signout() method and also expiring cookie explicitely as...
4
by: ad | last post by:
I use the Login controls of Asp.net 2.0 in my program. I want to logout a user by program, I try Session.Abandon() for this. But I found that the user is the same after I execute Session.Abandon()....
25
by: crescent_au | last post by:
Hi all, I've written a login/logout code. It does what it's supposed to do but the problem is when I logout and press browser's back button (in Firefox), I get to the last login page. In IE,...
1
by: G | last post by:
Hello Friends, Can i find any sample free webbased-application for employee login and logout timing. Thanks in Advance Appreciate for your Help. Thanks G
0
by: deneb | last post by:
Hello all? When I restart the page or just logout the page, cookie file is deleted automatically. What's wrong with me?? here is my code. ' If I success in Login process, Save user ID in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.