Web Wiz - Solar Powered Eco Web Hosting

  New Posts New Posts RSS Feed - Open in new window upon clicking Login
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Open in new window upon clicking Login

 Post Reply Post Reply
Author
iSec View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 February 2005
Status: Offline
Points: 1140
Post Options Post Options   Thanks (0) Thanks(0)   Quote iSec Quote  Post ReplyReply Direct Link To This Post Topic: Open in new window upon clicking Login
    Posted: 25 August 2010 at 6:36am

I have a .NET application (email system) based on a google email API. Currently, when a user clicks "Login" after entering their login info, the page redirects the user to a google.com based page. I would like to have the login form on my website's homepage to open in a new window when the user clicks Login or hit the Enter key. That way the user can still be on my website and also have the email page open in its own window.

- Frames won't work.
- Can't use javascript because the login page generates a unqiue value each time the page is refreshed, and that value is like an authentication token that must be preserved...
 
Is there anyway to do this while preserving the authentication data?
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3938
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 25 August 2010 at 5:15pm
To keep your tokens, rather than opening your current page in a new window, open the new page in a new window using target="_blank" in the link. You can use javascript to set the focus to the new window, leaving the old one in the background.



Lead me not into temptation... I know the short cut, follow me.
Back to Top
iSec View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 February 2005
Status: Offline
Points: 1140
Post Options Post Options   Thanks (0) Thanks(0)   Quote iSec Quote  Post ReplyReply Direct Link To This Post Posted: 26 August 2010 at 7:41am
dpyers, dude you r0ck!!

I have previously tried inserting the target="_blank" value into the code below, i feel bad for myself!

The code for the login button looks like this:

 <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Login" ValidationGroup="some-value" />

I tried inserting target="blank" in that tag, but it didn't do anything. But after reading your reply i put it in the <form> tag and it freaking worked this time!!!!




Edited by iSec - 26 August 2010 at 7:44am
"When it gets dark enough, you can see the stars"
-Charles A. Beard
Back to Top
iSec View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 February 2005
Status: Offline
Points: 1140
Post Options Post Options   Thanks (0) Thanks(0)   Quote iSec Quote  Post ReplyReply Direct Link To This Post Posted: 26 August 2010 at 7:47am
Now here's something I'd like some help with:

When the page opens in a new window, can the page in the background be auto-refreshed to erase the login credentials in case the user walks away from their computer and someone else clicks login and be able to login with the info that was already inputted? If so, how do I do it?

The other question I have is, what's the best way to integrate that ASP.NET login form into a classic ASP page? My homepage is based on classic ASP, but this system is built with .NET. Thanks for all your help!



Edited by iSec - 26 August 2010 at 7:52am
"When it gets dark enough, you can see the stars"
-Charles A. Beard
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3938
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 26 August 2010 at 9:33am
You can use either meta tags or javascript to handle a page refresh on either form.

On the second, login form, you'd want to also use a meta tag no-cache option and use javascript to clear the history so if someone hits the back button, their browser won't auto fill the form.

Don't forget to do a check for javascript and redirect them to a message stating it must be enabled.

Most hosts use a 20 minute session timer before expiring the session on the host. You can set that timer in either classic asp or .net code to whatever you want. I'd set it to expire 10-15 seconds before the page refresh.

I'd put the .net form into a separate html iframe container.

EDIT: no-cache can be tricky based upon the browser type. IIRC, there's several additional things that can be set using asp code that will handle 99% of the possible glitches. Something I found in on of my asp pags looks like this:
   <% Response.CacheControl = "no-cache" %>>
   <% Response.AddHeader "Pragma", "no-cache" %>
   <% Response.Expires = -1 %>




Edited by dpyers - 26 August 2010 at 9:39am

Lead me not into temptation... I know the short cut, follow me.
Back to Top
iSec View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 February 2005
Status: Offline
Points: 1140
Post Options Post Options   Thanks (0) Thanks(0)   Quote iSec Quote  Post ReplyReply Direct Link To This Post Posted: 26 August 2010 at 11:14pm
I tried the inline frame option, but for some reason upon clicking login it re-opens the login page in its own window, prompting the user to login, any idea why?

Edited by iSec - 26 August 2010 at 11:18pm
"When it gets dark enough, you can see the stars"
-Charles A. Beard
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.07
Copyright ©2001-2024 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Policy

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2024 Web Wiz Ltd. All rights reserved.