hi
I use below code to save session in database:
<sessionState mode="SQLServer" allowCustomSqlDatabase="true" timeout="1440" sqlConnectionString="Data Source=.;Initial Catalog=ASPState;User ID=sa;Password=2008"/>
now I want when users click on button it delete user's session from database
below are table code in database:
USE [ASPState]
GO
/****** Object: Table [dbo].[ASPStateTempApplications] Script Date: 12/22/2016 21:56:53 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ASPStateTempApplications](
[AppId] [int] NOT NULL,
[AppName] [char](280) NOT NULL,
PRIMARY KEY CLUSTERED
(
[AppId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
AND:
USE [ASPState]
GO
/****** Object: Table [dbo].[ASPStateTempSessions] Script Date: 12/22/2016 21:57:13 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ASPStateTempSessions](
[SessionId] [nvarchar](88) NOT NULL,
[Created] [datetime] NOT NULL,
[Expires] [datetime] NOT NULL,
[LockDate] [datetime] NOT NULL,
[LockDateLocal] [datetime] NOT NULL,
[LockCookie] [int] NOT NULL,
[Timeout] [int] NOT NULL,
[Locked] [bit] NOT NULL,
[SessionItemShort] [varbinary](7000) NULL,
[SessionItemLong] [image] NULL,
[Flags] [int] NOT NULL,
PRIMARY KEY CLUSTERED
(
[SessionId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[ASPStateTempSessions] ADD DEFAULT (getutcdate()) FOR [Created]
GO
ALTER TABLE [dbo].[ASPStateTempSessions] ADD DEFAULT ((0)) FOR [Flags]
GO
How I can delete session from these table?
Best regards
neda