Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 19th, 2006, 06:02 AM
Registered User
 
Join Date: Sep 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cookie Identifier & Redirect

Hi,

I have a webpage that members login to. I want the initial page of my website to go directly to the login page, but once members have logged in once the site doesn't ask them to log in again unless they logout. However, is there a javascript (or other form of code) that I can put on the login page so that when an already logged in user returns to the site, it wont show the log in page but another page.

Any help would be much apreciated!

Pete
Reply With Quote
  #2 (permalink)  
Old September 19th, 2006, 07:21 AM
Friend of Wrox
 
Join Date: May 2004
Location: , , .
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Peter,

Try a search on Google for "Cookie Redirect" scripts.

Cheers
Joe

'sync' <cr>
The name specified is not recognized as an internal or external command, operable program or batch file.
Reply With Quote
  #3 (permalink)  
Old September 22nd, 2006, 11:04 AM
Registered User
 
Join Date: Sep 2006
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, found one that works!

One problem though, the site I added it to needs to have a logout page, is there some 'onload' code that I can use in the header of my logout page that will delete the cookie that was created upon login?
Reply With Quote
  #4 (permalink)  
Old September 23rd, 2006, 05:25 AM
Friend of Wrox
 
Join Date: May 2004
Location: , , .
Posts: 212
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No I dont think so, you won't be able to delete files on the users machine as thats a security risk. I think what happens on most sites like this is that they "reset" the cookie, ie issue a new one that says "This user is logged out" probably using unique ids and timestamping or some such thing. The site probably then checks for the existence of this cookie (also against the date and time) when the user returns. If it doesn't find the cookie, then it will look for the existence of the "Logged in today" cookie. If it doesn't find that either then the user hasn't logged in today.

Bit vague I know, but thats my understanding of it.

Cheers
Joe

'sync' <cr>
The name specified is not recognized as an internal or external command, operable program or batch file.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Identifier expected andriy JSP Basics 0 November 1st, 2006 11:28 PM
identifier expected errors ali582 Java Basics 3 September 2nd, 2006 09:10 PM
Linux & KDE & C++ & QT & MYSQL & Kdevelop Munnnki Linux 0 January 2nd, 2005 05:41 PM
Identifier Expected syncmaster VB.NET 2002/2003 Basics 1 September 2nd, 2004 03:34 AM



All times are GMT -4. The time now is 06:51 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.