PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old July 10th, 2002, 06:57 PM
mhoward mhoward is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: UK
Posts: 49 mhoward User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Sessions

Hi,

I am trying to use sessions for a restricted area of a web site. So far I have my users logged in, and the session started using..

session_start();

session_register(username);
session_register(password);

How do I...

1. Ensure that the session exists on the next page. If it doesn't, I would redirect to login page.

2. Put a timeout on the session of 600secs so if the user does not so anything fo 10 mins, then clicks a link they are asked to log in again.

Reply With Quote
  #2  
Old July 11th, 2002, 05:09 AM
D1NGO D1NGO is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Perth, Australia
Posts: 221 D1NGO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Sessions

first one is easy, just run this:
php Code:
Original - php Code
  1.  
  2. if(($_SESSION(username) == '') || ($_SESSION(password) == ''))
  3. {
  4. echo 'session doesnt exist';
  5. }
  6. else
  7. {
  8. echo 'session does exist';
  9. }


although, i'm not too great with sessions, not sure about the timeout one..cookies are probably better for that...

Reply With Quote
  #3  
Old July 11th, 2002, 11:25 PM
ResNet9 ResNet9 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 101 ResNet9 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via AIM to ResNet9
RE: Sessions

make sure that you put a "require(your file)" statement so a user cannot jump ahead

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Sessions


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT