Tips Station Asp.net Article Seo Articles
Tutorials Code Samples
›  Home
›  Mission
›  About us
›  Contact Us
›  Feedback
›  Terms & Condition
Asp Articles
IT Solutions
 
› ASP.NET

› Programming Tips

› Ajax

› Asp

› ADO.NET

› Databases

› SEO

› CSS And Designing

› Php

 
Most Viewed Articles
 
› Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

› Change theme dynamically without page refresh in ASP.NET

› Install AJAX On Machines Running Visual Studio 2005

› Creating Pretty Popups Using AJAX

› Simple ASP Image Resize Function

› SQL Server Performance Counters

› ASP.Net Interview Questions And Their Answers

› Encode Url using ASP

› Difference Between DataGrid and GridView in Asp.Net

› Select Specific Value WithIn Drop Down List Or Radio Button List

more...
 
 
Home> Programming Tips
 
How to modify expire date of a cookie using Asp
 
To create cookies in ASP is so easy. After creating cookies, you will store it in client's visitors. While creating cookies, you must notice to modify the expire date of cookies. Because life length of a cookies is in your hands.
Dead or Alive!
It's not only a joke. When you create a cookies without modifying expire date, cookies can live until client's bworse closed.

For example:

<%
1. Response.Cookies("siteName")= "DevTutorials"
2. siteName = Response.Cookies("siteName")
3. response.write ("Site Name is :" & siteName & vbnewline)
%>
Now open your favorite browser (mine is Firefox :) ) and call cookie's page. Reload page after closing bworer but delete the (1) line. You will see that site name is displaying nothing. Because we did not modify expire date of cookie and we've lost it.

Let's add a expiration date to our code.

<%
0. Response.Cookies(("siteName").Expires= Now()+15
1. Response.Cookies("siteName")= "DevTutorials"
2. siteName = Response.Cookies("siteName")
3. response.write ("Site Name is :" & siteName & vbnewline)
%>
Reload page a few times after closing bworser. You will see that your cookies is alive.
 
 
Vrp Technologies
 
Serversea Hosting
 
 
Latest Articles
 
› Sending SMS With PHP

› MySQL Join Tutorial

› Make An RSS Feed Using PHP

› Intro To Object: Option Variables

› Design An Online Chat Room With PHP And MySQL

› Create Tell A Friend Script With HTML & PHP

› Benchmark And Optimize PHP Script Speed

› What Kind of DBA Are You?

› SQL Server Performance Counters

› SQL Server Performance Tips

more...
 
Random Articles
 
› UpdatePanel control in Asp.net Ajax

› Editing a DataGrid Control in Asp.net

› Add a Confirmation popup to a Button in Asp.Net

› Writing SEO Friendly URL using HttpHandlers in ASP.NET

› Find which control caused a postback - Asp.net

› Successful CSS Template Skins

› Intro To Object: Option Variables

› Understanding Transaction in ADO.NET

› Displaying Data using ASP.NET 2.0 Repeater

› Access Master Page controls from the Content Page - Asp.net

more...
 
Home Mission About us Contact us Feedback Terms Conditions
2008 © Copyright TipsStation. All rights reserved.